Skip to content

Commit

Permalink
tests: fix handling multiple callbacks
Browse files Browse the repository at this point in the history
closes #5233
  • Loading branch information
kristof-low authored and dougwilson committed Feb 19, 2024
1 parent 59aae76 commit 2a89eb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ describe('Router', function(){
var req2 = { url: '/foo/10/bar', method: 'get' };
var router = new Router();
var sub = new Router();
var cb = after(2, done)

done = after(2, done);

sub.get('/bar', function(req, res, next) {
next();
Expand All @@ -626,14 +626,14 @@ describe('Router', function(){
assert.ifError(err);
assert.equal(req1.ms, 50);
assert.equal(req1.originalUrl, '/foo/50/bar');
done();
cb()
});

router.handle(req2, {}, function(err) {
assert.ifError(err);
assert.equal(req2.ms, 10);
assert.equal(req2.originalUrl, '/foo/10/bar');
done();
cb()
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ describe('app.router', function(){

request(app)
.get('/foo.json')
.expect(200, 'foo as json', done)
.expect(200, 'foo as json', cb)
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/app.use.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('app', function(){

request(app)
.get('/forum')
.expect(200, 'forum', done)
.expect(200, 'forum', cb)
})

it('should set the child\'s .parent', function(){
Expand Down

0 comments on commit 2a89eb5

Please sign in to comment.