Skip to content

Commit 8fd456f

Browse files
committed
test: fix parser usage
1 parent 441d75b commit 8fd456f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/router/src/experimental/route-resolver/matchers/matcher-pattern.test-d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expectTypeOf, it } from 'vitest'
22
import {
33
MatcherPatternPathCustomParams,
4-
PARAM_INTEGER,
4+
PARAM_INTEGER_SINGLE,
55
PATH_PARAM_DEFAULT_PARSER,
66
PATH_PARAM_SINGLE_DEFAULT,
77
} from './matcher-pattern'
@@ -10,7 +10,7 @@ describe('MatcherPatternPathCustomParams', () => {
1010
it('can be generic', () => {
1111
const matcher = new MatcherPatternPathCustomParams(
1212
/^\/users\/([^/]+)$/i,
13-
{ userId: { parser: PATH_PARAM_DEFAULT_PARSER } },
13+
{ userId: { ...PATH_PARAM_DEFAULT_PARSER } },
1414
['users', 0]
1515
)
1616

@@ -35,7 +35,7 @@ describe('MatcherPatternPathCustomParams', () => {
3535
it('can be a simple param', () => {
3636
const matcher = new MatcherPatternPathCustomParams(
3737
/^\/users\/([^/]+)\/([^/]+)$/i,
38-
{ userId: { parser: PATH_PARAM_SINGLE_DEFAULT, repeat: true } },
38+
{ userId: { ...PATH_PARAM_SINGLE_DEFAULT, repeat: true } },
3939
['users', 0]
4040
)
4141
expectTypeOf(matcher.match('/users/123/456')).toEqualTypeOf<{
@@ -55,7 +55,7 @@ describe('MatcherPatternPathCustomParams', () => {
5555
/^\/profiles\/([^/]+)$/i,
5656
{
5757
userId: {
58-
parser: PARAM_INTEGER,
58+
...PARAM_INTEGER_SINGLE,
5959
// parser: PATH_PARAM_DEFAULT_PARSER,
6060
},
6161
},

0 commit comments

Comments
 (0)