Skip to content
Myr

tests: add route ordering test

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 7f04916 · Browse files · 1 file+39 added−0 removed
This commit

State

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

Diff stats

1 file+39 added−0 removed

  • tests:+39 added−0 removed

1 file+39 added−0 removed

modified:test/app.router.js+39 added
586 unmodified lines
587 .get('/account/edit')588 .expect('editing user 12', done);589 })590591 it('should run in order added', function(done){592 var app = express();593 var path = [];594595 app.get('*', function(req, res, next){596 path.push(0);597 next();598 });599600 app.get('/user/:id', function(req, res, next){601 path.push(1);602 next();603 });604605 app.use(function(req, res, next){606 path.push(2);607 next();608 });609610 app.all('/user/:id', function(req, res, next){611 path.push(3);612 next();613 });614615 app.get('*', function(req, res, next){616 path.push(4);617 next();618 });619620 app.use(function(req, res, next){621 path.push(5);622 res.end(path.join(','))623 });624625 request(app)626 .get('/user/1')627 .expect(200, '0,1,2,3,4,5', done);628 })629630 it('should be chainable', function(){631 var app = express();632 app.get('/', function(){}).should.equal(app);633 })
1 unmodified line