forked from MetaMask/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
34 lines (34 loc) · 1014 Bytes
/
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
module.exports = {
collectCoverage: true,
// Ensures that we collect coverage from all source files, not just tested
// ones.
collectCoverageFrom: ['./src/**/*.ts'],
// TODO: Test index.ts
coveragePathIgnorePatterns: ['./src/index.ts'],
coverageReporters: ['text', 'html'],
coverageThreshold: {
global: {
branches: 90,
functions: 96,
lines: 95,
statements: 95,
},
},
moduleFileExtensions: ['js', 'json', 'ts', 'node'],
preset: 'ts-jest',
// TODO: Enable resetMocks
// "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,
setupFiles: ['./tests/setupTests.ts'],
testEnvironment: 'jsdom',
testRegex: ['\\.test\\.(ts|js)$'],
testTimeout: 5000,
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};