-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjest.config.js
24 lines (24 loc) · 1.06 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
module.exports = {
testEnvironment: 'jsdom', // Use JSDOM to test
setupFiles: ['<rootDir>/test/setupJest.ts'], // setup files
snapshotSerializers: ['miniprogram-simulate/jest-snapshot-plugin'], // snapshot serializer
transform: {
'^.+\\.jsx?$': 'babel-jest', // Transform all .js and .jsx files
'^.+\\.tsx?$': 'ts-jest' // Transform all .ts and .tsx files
},
testPathIgnorePatterns: ['<rootDir>/examples/', 'esm', 'dist-titan'], // ignore e2e test
coveragePathIgnorePatterns: ['/__test__/*', 'node_modules'], // ignore test files
globals: {
'ts-jest': {
tsconfig: './tsconfig.json'
}
},
coverageThreshold: {
global: {
statements: 60, // %stmts是语句覆盖率 (statement coverage): 是不是每个语句都执行了?
branches: 60, // %Branch分支覆盖率 (branch coverage): 是不是每个if代码块都执行了?
functions: 60, // %Funcs函数覆盖率 (function coverage): 是不是每个函数都调用了?
lines: 60 // %Lines行覆盖率 (line coverage): 是不是每一行都执行了?
}
}
};