-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
51 lines (41 loc) · 917 Bytes
/
Copy pathjest.config.js
File metadata and controls
51 lines (41 loc) · 917 Bytes
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
51
module.exports = {
// 测试环境
testEnvironment: 'jsdom',
// 模块路径别名
moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/tests/__mocks__/styleMock.js',
},
// 测试文件匹配模式
testMatch: ['<rootDir>/tests/**/*.test.js'],
// 覆盖率收集
collectCoverageFrom: [
'src/**/*.js',
'!src/index.js',
'!src/**/*.scss',
],
// 覆盖率目录
coverageDirectory: 'coverage',
// 覆盖率报告格式
coverageReporters: ['text', 'lcov', 'html'],
// 覆盖率阈值
coverageThreshold: {
global: {
branches: 50,
functions: 50,
lines: 50,
statements: 50,
},
},
// 设置文件
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
// 转换配置
transform: {
'^.+\\.js$': 'babel-jest',
},
// 忽略转换的模块
transformIgnorePatterns: [
'/node_modules/',
],
// 详细输出
verbose: true,
}