Closed mbastian93 closed 2 years ago
Okay i just noticed: when using jest/babel-jest v^26.0.0 it works as expect. Therefore there must be an issue with v27 of those libaries
Hey, @mbastian93. Thanks for reporting this.
I'm not sure how Jest 26 resolves this, afaik the only relevant change in 27 was the removal of setImmediate
and some internal work on timers.
I can confirm that the sandbox above has its tests passing if I use node-fetch
and not axios.
The latest MSW has an issue with how Axios works (see #1169). I'm closing this as a duplicate.
I'm facing the same issue :(
oh fck, same issue for me
Related to https://github.com/mswjs/msw/issues/1125
Prerequisites
Environment check
msw
versionNode.js version
14 / 16
Reproduction repository
https://codesandbox.io/s/laughing-ully-x4wt2w
Reproduction steps
open provided CodeSandbox and run
npm test
; only the test case executing a POST request with neither body nor header provided succeeds, the others failCurrent behavior
When providing data (i.e. body) to a
POST
request, the test ends in a timeout. A breakpoint within the request handler of the 'mocked server' is not even reached.The exact same request when used against a 'real' nodeJS server (express)
Expected behavior
The tests should not result in a timeout and instead get processed by the handler.
I can not rule out, that my set up is wrong, however i followed the instructions to the best of my knowledge and understanding