Skip to content
Myr

tests: fix handling multiple callbacks

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

closes #5233

authored by christof louw · committed by Douglas Christopher Wilson · parent 59aae76 · Browse files · 3 files+5 added−5 removed
This commit

State

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

Diff stats

3 files+5 added−5 removed

  • tests:+5 added−5 removed

3 files+5 added−5 removed

modified:test/app.router.js+1 added-1 removed
894 unmodified lines
895 .expect(200, 'foo as html', cb)896897 request(app)898 .get('/foo.json')899 .expect(200, 'foo as json', done)899 .expect(200, 'foo as json', cb)900 })901 })902903 describe('when next() is called', function(){
208 unmodified lines
modified:test/app.use.js+1 added-1 removed
55 unmodified lines
56 .expect(200, 'blog', cb)5758 request(app)59 .get('/forum')60 .expect(200, 'forum', done)60 .expect(200, 'forum', cb)61 })6263 it('should set the child\'s .parent', function(){64 var blog = express()
478 unmodified lines
modified:test/Router.js+3 added-3 removed
604 unmodified lines
605 var req1 = { url: '/foo/50/bar', method: 'get' };606 var req2 = { url: '/foo/10/bar', method: 'get' };607 var router = new Router();608 var sub = new Router();609 var cb = after(2, done)610610 done = after(2, done);611612 sub.get('/bar', function(req, res, next) {613 next();614 });
10 unmodified lines
625 router.handle(req1, {}, function(err) {626 assert.ifError(err);627 assert.equal(req1.ms, 50);628 assert.equal(req1.originalUrl, '/foo/50/bar');629 done();629 cb()630 });631632 router.handle(req2, {}, function(err) {633 assert.ifError(err);634 assert.equal(req2.ms, 10);635 assert.equal(req2.originalUrl, '/foo/10/bar');636 done();636 cb()637 });638 });639 });640})