-
Notifications
You must be signed in to change notification settings - Fork 15
/
jest.config.mjs
37 lines (36 loc) · 1.11 KB
/
jest.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import inspector from "inspector";
const isDebuggerAttached = inspector.url() !== undefined;
export default {
restoreMocks: true,
collectCoverage: true,
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
coverageDirectory: "coverage",
coverageReporters: ["text-summary", "lcov"],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
errorOnDeprecated: true,
moduleNameMapper: {
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
"test/(.*)$": "<rootDir>/test/$1",
"~/(.*)$": "<rootDir>/src/$1",
},
transform: {
"\\.[jt]sx?$": "babel-jest",
"\\.(jpg|jpeg|png|gif|webp|svg|bmp|woff|woff2|ttf)$": "<rootDir>/test/transformers/importPathTransformer.js",
},
setupFilesAfterEnv: ["<rootDir>/test/setup.ts"],
globalTeardown: "<rootDir>/test/teardown.ts",
fakeTimers: {
enableGlobally: true,
},
verbose: true,
testEnvironment: "jsdom",
testTimeout: isDebuggerAttached ? 10000000 : 5000,
randomize: true,
};