-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
50 lines (50 loc) · 1.01 KB
/
jest.config.js
File metadata and controls
50 lines (50 loc) · 1.01 KB
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
47
48
49
50
/** @type {import('jest').Config} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
roots: ["<rootDir>"],
testMatch: [
"**/exercises/**/*.test.ts",
"**/exercises/**/*.test.tsx",
"**/components/__tests__/**/*.test.{js,ts,tsx}",
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
"^react-native$": "<rootDir>/__mocks__/react-native.js",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: false,
tsconfig: {
module: "commonjs",
jsx: "react-jsx",
},
},
],
},
globals: {
TEST_FILE: process.env.TEST_FILE || "solution",
},
collectCoverageFrom: [
"components/**/*.{ts,tsx}",
"exercises/**/solution.tsx",
"exercises/**/solution.ts",
"exercises/test-utils.ts",
"!**/*.test.{ts,tsx}",
"!**/__tests__/**",
"!**/problem.tsx",
"!**/work.tsx",
],
coverageReporters: ["text", "lcov"],
coverageThreshold: {
global: {
branches: 59,
functions: 76,
lines: 80,
statements: 80,
},
},
};