Skip to content

Commit

Permalink
fix: reproduce problem with params typing (4Catalyzer#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
steinybot committed Jan 31, 2024
1 parent f5d565d commit 2ce1eb6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/Matcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ describe('Matcher', () => {
},
]);

expect(
matcher.match({
pathname: '/a',
}),
).toEqual({
const missingMatch = matcher.match({ pathname: '/a' });

if (missingMatch != null && 0 in missingMatch.params) {
// FIXME: This type is wrong. It should be string | undefined.
const param: string = missingMatch.params[0];
expect(param).toBeUndefined();
}

expect(missingMatch).toEqual({
routeIndices: [0, 0],
routeParams: [{ foo: 'a' }, { 0: undefined }],
params: {
Expand Down

0 comments on commit 2ce1eb6

Please sign in to comment.