-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
40 lines (39 loc) · 1.14 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module.exports = {
globals: {
'ts-jest': {
tsconfig: './test/tsconfig.json',
},
},
testMatch: ['<rootDir>/test/**/?(*.)+(spec|test).+(ts|tsx|js)'],
setupFilesAfterEnv: ['<rootDir>/test/_setup.js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
verbose: false,
collectCoverage: false,
coverageReporters: ['json'],
coverageDirectory: '.coverage',
/**
* restoreMocks [boolean]
*
* Default: false
*
* Automatically restore mock state between every test.
* Equivalent to calling jest.restoreAllMocks() between each test.
* This will lead to any mocks having their fake implementations removed
* and restores their initial implementation.
*/
restoreMocks: true,
resetMocks: true,
/**
* resetModules [boolean]
*
* Default: false
*
* By default, each test file gets its own independent module registry.
* Enabling resetModules goes a step further and resets the module registry before running each individual test.
* This is useful to isolate modules for every test so that local module state doesn't conflict between tests.
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
};