Jest: Add mock service worker server commands to jest.setup.js
This commit makes the `msw` server globally available to all test files. Given that the majority of our test files will ultimately make calls to APIs using RTK Query (calls are made in both the table and the wizard), making these globally available in jest.setup.js is reasonable.
This commit is contained in:
parent
a0ed7cd37e
commit
8adfd793d6
1 changed files with 5 additions and 0 deletions
|
|
@ -1 +1,6 @@
|
|||
import 'whatwg-fetch';
|
||||
import { server } from './src/test/mocks/server';
|
||||
|
||||
beforeAll(() => server.listen());
|
||||
afterEach(() => server.resetHandlers());
|
||||
afterAll(() => server.close());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue