-
Notifications
You must be signed in to change notification settings - Fork 134
/
jest.config.js
45 lines (40 loc) · 1.29 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
41
42
43
44
45
'use strict';
/**
* https://jestjs.io/docs/en/configuration
*/
const jest = {
testEnvironment: 'node',
collectCoverage: false,
setupFilesAfterEnv: ['<rootDir>/jest.setup-test.js'],
coveragePathIgnorePatterns: [
'<rootDir>/(.*/?)__sandbox__',
'<rootDir>/dev-utils',
],
testPathIgnorePatterns: ['<rootDir>/(.*/?)__sandbox__'],
/**
* Automatically reset mock state between every test.
* Equivalent to calling jest.resetAllMocks() between each test.
*
* Sane default with resetModules: true because mocks need to be inside beforeEach
* for them to work correctly
*
* https://jestjs.io/docs/en/configuration#resetmocks-boolean
*/
resetMocks: true,
/**
* The module registry for every test file will be reset before running each individual test.
* This is useful to isolate modules for every test so that local module state doesn't conflict between tests.
*
* https://jestjs.io/docs/en/configuration#resetmodules-boolean
*/
resetModules: true,
/**
* Equivalent to calling jest.restoreAllMocks() between each test.
*
* Resets jest.spyOn mocks only
*
* https://jestjs.io/docs/en/configuration#restoremocks-boolean
*/
restoreMocks: true,
};
module.exports = jest;