An onUnhandledRequest error does not make the test fail #943
Replies: 2 comments 7 replies
-
Hey, @bennettdams. Could you please ensure you're using the latest version of the library?
You've chosen the right API: setting |
Beta Was this translation helpful? Give feedback.
-
see this behaviour in UPD tried "msw": "2.7.0", same behaviour, test passes, error is logged
|
Beta Was this translation helpful? Give feedback.
-
I just started using MSW and found out that an
onUnhandledRequest
error does not make the test fail:Here's my config:
jest.config.js
msw-setup.ts
Is there something specific that has to be configured for my test to fail in such situations?
BTW: As a beginner of MSW, I looked for a solution to block all requests that are not handled via MSW. I still wanted to get notified of missing handlers, so using wildcards (e.g.
rest.get("*")
) was not an option. The docs and also the console message whenonUnhandledRequest
is "triggered" do not make this clear in my opinion. Without this discussion, I would've never known that the requests are also blocked (which is exactly what I wanted).Beta Was this translation helpful? Give feedback.
All reactions