upgrade koa-route

This commit is contained in:
Lloyd Brookes
2015-11-22 19:38:08 +00:00
parent 63f329b297
commit f0d36ac89f
4 changed files with 18 additions and 5 deletions

View File

@ -165,6 +165,18 @@ test('rewrite: proxy', function (t) {
}})
})
test('rewrite: proxy, two url tokens', function (t) {
t.plan(2)
const app = localWebServer({
log: { format: 'none' },
rewrite: [ { from: '/:package/:version', to: 'http://registry.npmjs.org/:package/:version' } ]
})
launchServer(app, { path: '/command-line-args/1.0.0', onSuccess: response => {
t.strictEqual(response.res.statusCode, 200)
t.ok(/command-line-args/.test(response.data))
}})
})
test('rewrite: proxy with port', function (t) {
t.plan(2)
const one = localWebServer({