app.response.js
This file
Path
test/app.response.js
44 lines · 911 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 82731da point at it.
Merge pull request #1503 from shesek/settings-inheritanceTJ Holowaychukbefore adoption82731da
lines 1–44why, one step back12var express = require('../')3 , request = require('./support/http');45describe('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 })22 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 };30 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})