mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
42b3e5602e
# Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
18 lines
465 B
TypeScript
18 lines
465 B
TypeScript
import { jest } from "@jest/globals";
|
|
|
|
import { server } from "./src/mocks/server.js";
|
|
|
|
// Establish API mocking before all tests.
|
|
beforeAll(() => {
|
|
server.listen();
|
|
// @ts-ignore Not clear why this causes an error??
|
|
global.jest = jest;
|
|
});
|
|
|
|
// Reset any request handlers that we may add during the tests,
|
|
// so they don't affect other tests.
|
|
afterEach(() => server.resetHandlers());
|
|
|
|
// Clean up after the tests are finished.
|
|
afterAll(() => server.close());
|