-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
executable file
·47 lines (37 loc) · 1.25 KB
/
jest.config.js
File metadata and controls
executable file
·47 lines (37 loc) · 1.25 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
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
module.exports = {
// All imported modules in your tests should be mocked automatically
automock: false,
// Stop running tests after `n` failures
bail: 5,
// Automatically clear mock calls, instances and results before every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: false,
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
'\\\\node_modules\\\\'
],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
'json',
'text',
'lcov',
'clover'
],
// jest 测试 TS 时, 不支持 import/from 这种模块的导入, 所以需要换成 ts-jest 来预解析
'transform': {
'\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js'
},
// The glob patterns Jest uses to detect test files
testMatch: [
'**/?(*.)+(spec|test).[t]s?(x)'
],
}