/
githubmirror
/
express
Обзор
Документация
Войти
/
githubmirror
/
express
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.17.2
test/app.response.js
43 строки
896 B
Jonathan Ong
remove unnecessary test/support/http
06 мар 2014, 10:06
06 мар 2014, 10:06
643397e
Код
Авторство
О чём код?
var express = require('../') , request = require('supertest'); describe('app', function(){ describe('.response', function(){ it('should extend the response prototype', function(done){ var app = express(); app.response.shout = function(str){ this.send(str.toUpperCase()); }; app.use(function(req, res){ res.shout('hey'); }); request(app) .get('/') .expect('HEY', done); }) it('should not be influenced by other app protos', function(done){ var app = express() , app2 = express(); app.response.shout = function(str){ this.send(str.toUpperCase()); }; app2.response.shout = function(str){ this.send(str); }; app.use(function(req, res){ res.shout('hey'); }); request(app) .get('/') .expect('HEY', done); }) }) })