-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
30 lines (29 loc) · 871 Bytes
/
jest.config.ts
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
import type { Config } from '@jest/types';
// TODO option to turn warnings into errors?
const coveragePercentage = 0; // TODO change to 100
const testUtilsPath = '<rootDir>/tests/tests-utils';
const config: Config.InitialOptions = {
bail: true,
verbose: true,
collectCoverage: true,
coverageDirectory: '<rootDir>/coverage-results/',
coverageReporters: ['lcov', 'text'],
coverageThreshold: {
global: {
branches: coveragePercentage,
functions: coveragePercentage,
lines: coveragePercentage,
statements: coveragePercentage,
},
},
testEnvironment: 'jsdom',
setupFilesAfterEnv: [`${testUtilsPath}/setupTests.ts`],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
'^.+\\.svg$': `${testUtilsPath}/svgTransform.ts`,
},
moduleNameMapper: {
'^.+\\.(css|less)$': 'identity-obj-proxy',
},
};
export default config;