Requests don't work consistently with MSW #676
Replies: 4 comments
-
I have confirmed the issue does not persist when I use |
Beta Was this translation helpful? Give feedback.
-
Do you experience the same behavior if you disable MSW in your tests? I think this still may be an issue with how MSW handles the request instance created by |
Beta Was this translation helpful? Give feedback.
-
I attempted this today and the tests work if I use the real server and don't mock the response. So the errors only appear when using MSW. |
Beta Was this translation helpful? Give feedback.
-
Hey @charklewis @kettanaito - I still have this issue in node 20. Did you find a solution? |
Beta Was this translation helpful? Give feedback.
-
I am trying to set up a MSW to test my app and I have found that when I use the
request
method from this SDK the requests haphazardly fail. I have been tracking this issue on MSW's repo as I thought it was a bug there. You can see that issue here - mswjs/msw#1143.I have created a small repo you can use to reproduce the error. Are you able to advice if there are changes I need to make to the configuration in order to get these tests to pass? If you swap out the
client.request
method for the typicalfetch
you will see the pass without issues.Link to repo - https://github.com/charklewis/sb9or3
Beta Was this translation helpful? Give feedback.
All reactions