prev.params should always exist (#227)

This commit is contained in:
Tim Wisniewski
2016-08-23 05:45:53 -04:00
committed by GitHub
parent cdabe22e59
commit e44f9619e9
2 changed files with 18 additions and 1 deletions
+17
View File
@@ -163,4 +163,21 @@ test('routing', function (t) {
app.start()
})
t.test('prev.params always exists', function (t) {
t.plan(1)
const choo = require('../..')
const app = choo()
app.router('/users/123', (route) => [
route('/users', [
route('/:user', function (state, prev) {
t.ok(prev.params)
})
])
])
app.start()
})
})