How to debug MSW in my React tests? #1385
-
I have a component that will show loading spinner till the api return. My test is waiting for that to be replaced with content from the API but it never happens. How can I debug in test mode to even see if MSW is working and or what could be going wrong with the API call |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, @jrock2004. We have a documentation recipe on debugging uncaught requests. You can use it also to debug if MSW is working at all by setting the |
Beta Was this translation helpful? Give feedback.
Hey, @jrock2004.
We have a documentation recipe on debugging uncaught requests. You can use it also to debug if MSW is working at all by setting the
onUnhandledRequest: "error"
option inserver.listen()
and making some unhandled arbitrary request. If it errors, MSW works; if it doesn't, your setup is incorrect and you should revisit Node integration instructions.