Skip to content
Myr

Added failing constructor middleware test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2bea014 · Browse files · 2 files+30 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+30 added−1 removed

  • tests:+26 added−1 removed
  • other:+4 added−0 removed

2 files+30 added−1 removed

modified:lib/express/server.js+4 added
modified:test/express.test.js+26 added-1 removed
32 unmodified lines
33 { url: '/user/12', method: 'PUT' },34 { body: 'updated user 12' });35 },36 37 'test constructor middleware': function(assert, beforeExit){38 var calls = [];39 function one(req, res, next){40 calls.push('one');41 next();42 }43 function two(req, res, next){44 calls.push('two');45 next();46 }47 var app = express.createServer(one, two);48 app.get('/', function(req, res){49 res.writeHead(200, {});50 res.end('foo bar');51 });52 53 assert.response(app,54 { url: '/' },55 { body: 'foo bar' });56 57 beforeExit(function(){58 assert.eql(['one', 'two'], calls);59 });60 },61 37 'test middleware': function(assert){62 'test #use()': function(assert){63 var app = express.createServer();6465 app.get('/users', function(req, res, params, next){66 next(new Error('fail!!'));
56 unmodified lines