fleet/ee/fleetd-chrome/jest.setup.ts
Zach Wasserman 42b3e5602e
Fleetd for Chrome (#10281)
# 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
2023-03-16 09:01:10 -03:00

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());