This is an example React Native app using RTK query with MSW and Jest where there is an issue with the sad path causing jest to error on test completion:
thrown: Object {
"data": null,
"status": 500,
}
at _getError (../../node_modules/jest-circus/build/utils.js:431:18)
at Array.map (<anonymous>)- Run
yarn - Run
npm test - Look at
Example.tsxfor more info
- We are using
RTK Queryto handle API calls found inExample.apiSlice.ts - Look at tests found in
Example.test Example.mswcontains MSW'sExample.tsxhas notes on using try catch vs not resulting in the test either failing or passing