-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
43 lines (42 loc) · 1012 Bytes
/
jest.config.ts
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
import type { Config } from "@jest/types";
import { compilerOptions } from "./tsconfig.json";
// Or async function
export default async (): Promise<Config.InitialOptions> => ({
coverageProvider: "v8",
collectCoverage: true,
collectCoverageFrom: ["./src/**"],
clearMocks: true,
verbose: true,
testEnvironment: "jsdom",
preset: "ts-jest",
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
diagnostics: false,
},
],
"^.+\\.(js|jsx)$": "babel-jest",
},
moduleDirectories: ["node_modules", "test-utils", __dirname],
modulePaths: [compilerOptions.baseUrl],
coverageDirectory: "<rootDir>/tests/coverage/jest",
coveragePathIgnorePatterns: [
"./node_modules/",
"./babel.config.js",
"src/constants.ts",
"src/index.tsx",
"src/main.tsx",
"src/vite-env.d.ts",
"src/test-utils/",
".*__snapshots__/.*",
],
coverageThreshold: {
global: {
lines: 0,
branches: 0,
functions: 0,
statements: 0,
},
},
});