Skip to content

Commit

Permalink
#56 Setup mock api
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraBergstrom committed Jul 4, 2023
1 parent 0baa4f9 commit 1a10c93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import "@testing-library/jest-dom";
import { setupServer } from "msw/handlers";
import { handlers } from "./mocks/handlers";

const server = setupServer(...handlers);

beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());

0 comments on commit 1a10c93

Please sign in to comment.