We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
$.run
1 parent 1062d25 commit e7aa014Copy full SHA for e7aa014
test/index.js
@@ -178,6 +178,25 @@ test('$.run (wildcard)', t => {
178
ctx.run('foo/bar/baz/bat/quz');
179
});
180
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
200
test('$.run (404)', t => {
201
t.plan(11);
202
0 commit comments