Skip to content
Myr

app.response.js

This file

Path

test/app.response.js

44 lines · 896 bytes · JavaScript

Last changed by

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

History of this file

Take it

The walk stopped after 200 commits: lines older than a10f695 point at it.

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 1–2why, one step back
1
2var express = require('../')

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

line 3why, one step back
3 , request = require('supertest');

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 4–21why, one step back
4
5describe('app', function(){6 describe('.response', function(){7 it('should extend the response prototype', function(done){8 var app = express();910 app.response.shout = function(str){11 this.send(str.toUpperCase());12 };1314 app.use(function(req, res){15 res.shout('hey');16 });1718 request(app)19 .get('/')20 .expect('HEY', done);21 })

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

line 22why, one step back
22

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 23–29why, one step back
23 it('should not be influenced by other app protos', function(done){
24 var app = express()25 , app2 = express();2627 app.response.shout = function(str){28 this.send(str.toUpperCase());29 };

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

line 30why, one step back
30

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 31–44why, one step back
31 app2.response.shout = function(str){
32 this.send(str);33 };3435 app.use(function(req, res){36 res.shout('hey');37 });3839 request(app)40 .get('/')41 .expect('HEY', done);42 })43 })44})