You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moveMSW's server management from `PhoneBook.test.tsx` to Jest'ssetupfilevia [`setupFilesAfterEnv`](https://jestjs.io/docs/configuration#setupfilesafterenv-array).
342
343
343
-
```tsx title=__mocks__/axios.ts
344
-
const chuckNorrisError = () => {
345
-
throw Error(
346
-
"Please ensure you mock 'Axios' - Only Chuck Norris is allowed to make API requests when testing ;)",
347
-
);
348
-
};
344
+
```tsx title=examples/cookbook/jest-setup.ts
345
+
// Enable API mocking via Mock Service Worker (MSW)
346
+
beforeAll(() => server.listen());
347
+
// Reset any runtime request handlers we may add during the tests
0 commit comments