-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
jest.config.js
49 lines (49 loc) · 1.32 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
46
47
48
49
module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/**/*.test.ts',
'!<rootDir>/src/vendor/**/*',
],
coverageDirectory: 'coverage',
coverageReporters: ['html', 'json-summary', 'text'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
preset: 'ts-jest',
// "resetMocks" resets all mocks, including mocked modules, to jest.fn(),
// between each test case.
resetMocks: true,
// "restoreMocks" restores all mocks created using jest.spyOn to their
// original implementations, between each test. It does not affect mocked
// modules.
restoreMocks: true,
projects: [
{
displayName: 'Runner: default',
preset: 'ts-jest',
testRegex: ['\\.test\\.(ts|js)$'],
testPathIgnorePatterns: [
'<rootDir>/src/WebWorker/*',
'<rootDir>/src/window/*',
],
},
{
displayName: 'Runner: Electron',
preset: 'ts-jest',
runner: '@jest-runner/electron',
testEnvironment: '@jest-runner/electron/environment',
testMatch: [
'<rootDir>/src/WebWorker/*.test.ts',
'<rootDir>/src/window/*.test.ts',
],
},
],
testTimeout: 2500,
};