An onUnhandledRequest error does not make the test fail #943
Unanswered
bennettdams
asked this question in
Q&A
Replies: 1 comment 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.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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