Skip to content

Commit 4e27dd7

Browse files
committed
Fix test on node 22
1 parent cd21c5f commit 4e27dd7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/react-router/__tests__/router/navigation-test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ describe("navigations", () => {
171171
);
172172
expect(t.router.state.loaderData).toEqual({});
173173

174-
expect(t.router.state.errors?.foo).toEqual(
175-
new SyntaxError(
176-
"Unexpected non-whitespace character after JSON at position 15"
177-
)
174+
expect(t.router.state.errors?.foo).toBeInstanceOf(SyntaxError);
175+
expect(t.router.state.errors?.foo.message).toContain(
176+
"Unexpected non-whitespace character after JSON at position 15"
178177
);
179178
});
180179

@@ -207,10 +206,9 @@ describe("navigations", () => {
207206
);
208207
expect(t.router.state.loaderData).toEqual({});
209208

210-
expect(t.router.state.errors?.root).toEqual(
211-
new SyntaxError(
212-
"Unexpected non-whitespace character after JSON at position 15"
213-
)
209+
expect(t.router.state.errors?.root).toBeInstanceOf(SyntaxError);
210+
expect(t.router.state.errors?.root.message).toContain(
211+
"Unexpected non-whitespace character after JSON at position 15"
214212
);
215213
});
216214

0 commit comments

Comments
 (0)