generated from dinosoeren/node-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.mjs
32 lines (32 loc) · 822 Bytes
/
jest.config.mjs
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
export default {
cacheDirectory: './jest/cache',
collectCoverage: true,
coverageDirectory: './jest/coverage',
coverageReporters: ['json', 'lcov', ['text', { skipFull: true }], 'clover'],
resetMocks: true,
resetModules: true,
restoreMocks: true,
roots: ['<rootDir>/src'],
testEnvironment: 'jsdom',
collectCoverageFrom: [
'<rootDir>/src/**/*.{ts,tsx}',
'!<rootDir>/src/**/*.d.ts',
'!<rootDir>/src/**/*.stories.{ts,tsx}',
'!<rootDir>/src/**/*.test.{ts,tsx}',
'!<rootDir>/src/**/test-utils/*.{ts,tsx}',
],
coverageThreshold: {
global: {
branches: 20,
functions: 40,
lines: 50,
statements: 70,
},
},
moduleNameMapper: {
'\\.(?:css|gif|jpg|png|scss)$': '<rootDir>/test-utils/empty.ts',
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};