Skip to content
Myr

tests: add test for error handler in route

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

closes #2228

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 4fe1073 · Browse files · 1 file+26 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+26 added−0 removed

  • tests:+26 added−0 removed

1 file+26 added−0 removed

modified:test/app.router.js+26 added
834 unmodified lines
835 calls.should.eql(['/foo/:bar?', '/foo']);836 done();837 })838 })839840 it('should call handler in same route, if exists', function(done){841 var app = express();842843 function fn1(req, res, next) {844 next(new Error('boom!'));845 }846847 function fn2(req, res, next) {848 res.send('foo here');849 }850851 function fn3(err, req, res, next) {852 res.send('route go ' + err.message);853 }854855 app.get('/foo', fn1, fn2, fn3);856857 app.use(function (err, req, res, next) {858 res.end('error!');859 })860861 request(app)862 .get('/foo')863 .expect('route go boom!', done)864 })865 })866867 it('should allow rewriting of the url', function(done){868 var app = express();
60 unmodified lines