-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
46 lines (43 loc) · 1.02 KB
/
jest.config.js
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
38
39
40
41
42
43
44
45
46
const styleExtension = "\\.(css|less|scss|sass)$";
const assetExtension = "\\.(gif|ttf|eot|svg|png)$";
const moduleNameMapper = {
[styleExtension]: "identity-obj-proxy",
[assetExtension]: "<rootDir>/fileMock.tsx",
};
const config = {
injectGlobals: true,
testEnvironment: "jsdom",
testTimeout: 10000,
rootDir: ".",
setupFiles: ["<rootDir>/setup.ts"],
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
moduleNameMapper,
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsConfig: "tsconfig.test.json",
},
],
},
collectCoverageFrom: ["src/**/*.{ts,tsx}", "!src/**/*.stories.tsx"],
coveragePathIgnorePatterns: [
"/node_modules/",
"src/test-helpers/",
"src/array.prototype.tosorted.d.ts",
"src/fela-sort-classnames.d.ts",
"src/html-attributes.d.ts",
"src/vite-env.d.ts",
"src/stories/",
"src/pages/",
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
};
export default config;