Skip to content

Commit 9b14321

Browse files
authored
test: Flesh out splat tests a bit (#64)
1 parent 9fb5362 commit 9b14321

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/node/router-match.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { test } from 'uvu';
22
import * as assert from 'uvu/assert';
33

4-
// @ts-expect-error - no types, not meant for public use
54
import { exec } from '../../src/router.js';
65

76
function execPath(path, pattern, opts) {
@@ -28,7 +27,10 @@ test('Param rest segment', () => {
2827
const accurateResult = execPath('/user/foo', '/user/*');
2928
assert.equal(accurateResult, { path: '/user/foo', params: {}, query: {}, rest: '/foo' });
3029

31-
const inaccurateResult = execPath('/', '/user/:id/*');
30+
const accurateResult2 = execPath('/user/foo/bar/baz', '/user/*');
31+
assert.equal(accurateResult2, { path: '/user/foo/bar/baz', params: {}, query: {}, rest: '/foo/bar/baz' });
32+
33+
const inaccurateResult = execPath('/user', '/user/*');
3234
assert.equal(inaccurateResult, undefined);
3335
});
3436

0 commit comments

Comments
 (0)