Skip to content

Commit 61c09f6

Browse files
committed
chore: Improve test.
Signed-off-by: Paolo Insogna <[email protected]>
1 parent f1e044e commit 61c09f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,11 @@ async function run () {
989989
upstream: `http://localhost:${origin.server.address().port}`,
990990
prefix: '/api',
991991
rewritePrefix: '/api2/',
992-
preRewrite (url) {
992+
preRewrite (url, params, prefix) {
993+
t.assert.strictEqual(url, '/api/abc')
994+
t.assert.ok(typeof params, 'object')
995+
t.assert.strictEqual(params['*'], 'abc')
996+
t.assert.strictEqual(prefix, '/api')
993997
return url.replace('abc', 'a')
994998
}
995999
})

0 commit comments

Comments
 (0)