fleet/ee/fleetd-chrome/jest.config.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

41 lines
1.3 KiB
TypeScript

/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
export default {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
extensionsToTreatAsEsm: [".ts", ".tsx"],
// A preset that is used as a base for Jest's configuration
preset: "ts-jest/presets/default-esm",
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
"^.+\\.m?[tj]sx?$": [
"ts-jest",
{
useESM: true,
},
],
},
// The paths to modules that run some code to configure or set up the testing environment before
// each test
setupFiles: [],
setupFilesAfterEnv: ["./jest.setup.ts"],
// The test environment that will be used for testing
testEnvironment: "./jsdomwithfetch.ts",
// Define additional global variables
globals: {
// Neither jest nor jsdom include the chrome global, so we need to define it here.
chrome: { runtime: {} },
},
};