Skip to content
Myr

tests: verify all handlers called in stack 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 7ec5dd2 · Browse files · 1 file+20 added−2 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+20 added−2 removed

  • tests:+20 added−2 removed

1 file+20 added−2 removed

modified:test/Router.js+20 added-2 removed
81 unmodified lines
82 this.timeout(5000) // long-running test8384 var router = new Router()8586 router.get('/foo', function (req, res, next) {87 req.counter = 088 next()89 })9091 for (var i = 0; i < 6000; i++) {87 router.get('/foo', function (req, res, next) { next() })92 router.get('/foo', function (req, res, next) {93 req.counter++94 next()95 })96 }9798 router.get('/foo', function (req, res) {99 assert.strictEqual(req.counter, 6000)100 res.end()101 })102103 router.handle({ url: '/foo', method: 'GET' }, { end: done })
3 unmodified lines
107 this.timeout(5000) // long-running test108109 var router = new Router()110111 router.use(function (req, res, next) {112 req.counter = 0113 next()114 })115116 for (var i = 0; i < 6000; i++) {103 router.use(function (req, res, next) { next() })117 router.use(function (req, res, next) {118 req.counter++119 next()120 })121 }122123 router.use(function (req, res) {124 assert.strictEqual(req.counter, 6000)125 res.end()126 })127128 router.handle({ url: '/', method: 'GET' }, { end: done })
485 unmodified lines