app.response.js
This file
Path
test/app.response.js
44 lines · 896 bytes · JavaScript
Last changed by
remove unnecessary test/support/httpJonathan Ongbefore adoption643397e
History of this fileTake it
The walk stopped after 200 commits: lines older than 2e68ddb point at it.
expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 1–2why, one step back12var express = require('../')remove unnecessary test/support/httpJonathan Ongbefore adoption643397e
line 3why, one step back3 , request = require('supertest');expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 4–21why, one step back45describe('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 adoption643397e
line 22why, one step back22expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 23–29why, one step back23 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 adoption643397e
line 30why, one step back30expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 31–44why, one step back31 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})