Skip to content

Commit e7aa014

Browse files
committed
chore: assert $.run drops query string;
- See #9
1 parent 1062d25 commit e7aa014

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,25 @@ test('$.run (wildcard)', t => {
178178
ctx.run('foo/bar/baz/bat/quz');
179179
});
180180

181+
test('$.run (query)', t => {
182+
t.plan(4);
183+
184+
let ctx = (
185+
navaid()
186+
.on('foo/*', o => {
187+
t.pass('~> called "foo/*" route');
188+
t.is(o.wild, 'baz/bat', '~> trims query from "wild" key');
189+
})
190+
.on('/bar/:id', o => {
191+
t.pass('~> called "/bar/:id" route');
192+
t.is(o.id, 'hello', '~> trims query from "id" key');
193+
})
194+
);
195+
196+
ctx.run('foo/baz/bat?abc=123');
197+
ctx.run('bar/hello?a=b&c=d');
198+
});
199+
181200
test('$.run (404)', t => {
182201
t.plan(11);
183202

0 commit comments

Comments
 (0)