middleware.basic.js
This file
Path
test/middleware.basic.js
39 lines · 931 bytes · JavaScript
Last changed by
Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe
History of this fileTake it
The walk stopped after 200 commits: lines older than e29fa25 point at it.
Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25
lines 1–30why, one step back12var express = require('../');3var request = require('supertest');45describe('middleware', function(){6 describe('.next()', function(){7 it('should behave like connect', function(done){8 var app = express()9 , calls = [];1011 app.use(function(req, res, next){12 calls.push('one');13 next();14 });1516 app.use(function(req, res, next){17 calls.push('two');18 next();19 });2021 app.use(function(req, res){22 var buf = '';23 res.setHeader('Content-Type', 'application/json');24 req.setEncoding('utf8');25 req.on('data', function(chunk){ buf += chunk });26 req.on('end', function(){27 res.end(buf);28 });29 });30Merge tag '4.16.2'Douglas Christopher Wilsonbefore adoption62e12fe
line 31why, one step back31 request(app)Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25
lines 32–34why, one step back32 .get('/')33 .set('Content-Type', 'application/json')34 .send('{"foo":"bar"}')Merge tag '4.14.0'Douglas Christopher Wilsonbefore adoption1dbfee6
lines 35–36why, one step back35 .expect('Content-Type', 'application/json')36 .expect(200, '{"foo":"bar"}', done)Add configurable query parserDouglas Christopher Wilsonbefore adoptione29fa25
lines 37–39why, one step back37 })38 })39})