Skip to content
Myr

tests: add more route tests

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 4279e6e · Browse files · 3 files+48 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

3 files+48 added−0 removed

  • tests:+48 added−0 removed

3 files+48 added−0 removed

modified:test/app.route.js+10 added
modified:test/Route.js+19 added
165 unmodified lines
166 });167168 route.dispatch({ method: 'get' }, {});169 });170171 it('should handle throwing inside error handlers', function(done) {172 var route = new Route('');173174 route.get(function(req, res, next){175 throw new Error('boom!');176 });177178 route.get(function(err, req, res, next){179 throw new Error('oops');180 });181182 route.get(function(err, req, res, next){183 assert.equal(err.message, 'oops');184 done();185 });186187 route.dispatch({ url: '/', method: 'GET' }, {}, done);188 });189 })190})
modified:test/Router.js+19 added
129 unmodified lines
130 });131132 router.handle({ url: '/foo/2', method: 'GET' }, {}, done);133 });134135 it('should handle throwing inside error handlers', function(done) {136 var router = new Router();137138 router.use(function(req, res, next){139 throw new Error('boom!');140 });141142 router.use(function(err, req, res, next){143 throw new Error('oops');144 });145146 router.use(function(err, req, res, next){147 assert.equal(err.message, 'oops');148 done();149 });150151 router.handle({ url: '/', method: 'GET' }, {}, done);152 });153 })154155 describe('.all', function() {156 it('should support using .all to capture all http verbs', function(done){
143 unmodified lines