Description
When testing sad path for mutations and lazy queries, unless I use an empty catch statement at the end of the the promise my tests fail when using msw to return a 400/500 error.
Reproduction steps
Run yarn test
The sad path tests will fail
Go to Example.tsx and uncomment the function with try catch and comment the function without try catch.
Run yarn test
The tests pass
Current behavior
I get this error at the end of the tests when I do not catch an error using an RTK API mutation or lazy query
thrown: Object {
"data": null,
"status": 500,
}
at _getError (../../node_modules/jest-circus/build/utils.js:431:18)
at Array.map (<anonymous>)
Expected behavior
Jest shouldn't be throwing an error
Description When testing sad path for mutations and lazy queries, unless I use an empty catch statement at the end of the the promise my tests fail when using msw to return a 400/500 error.
I have also raised this issue in MSW and they said it was not an issue on their side https://github.com/mswjs/msw/issues/1661
Reproduction repository https://github.com/DominicGBauer/msw-test-example
Reproduction steps Run yarn test The sad path tests will fail Go to Example.tsx and uncomment the function with try catch and comment the function without try catch. Run yarn test The tests pass
Current behavior I get this error at the end of the tests when I do not catch an error using an RTK API mutation or lazy query
Expected behavior Jest shouldn't be throwing an error