debian-image-builder-frontend/jest.setup.js
lucasgarfield 8adfd793d6 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.
2023-02-22 16:26:15 +01:00

6 lines
181 B
JavaScript

import 'whatwg-fetch';
import { server } from './src/test/mocks/server';
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());