File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/react-router/__tests__/router Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -171,10 +171,9 @@ describe("navigations", () => {
171
171
) ;
172
172
expect ( t . router . state . loaderData ) . toEqual ( { } ) ;
173
173
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"
178
177
) ;
179
178
} ) ;
180
179
@@ -207,10 +206,9 @@ describe("navigations", () => {
207
206
) ;
208
207
expect ( t . router . state . loaderData ) . toEqual ( { } ) ;
209
208
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"
214
212
) ;
215
213
} ) ;
216
214
You can’t perform that action at this time.
0 commit comments