-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
38 lines (33 loc) · 1021 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
31
32
33
34
35
36
37
38
import type { Config } from '@jest/types';
import type { InitialOptionsTsJest } from 'ts-jest';
const pathIgnorePatterns: string[] = [
'<rootDir>/dist/',
'<rootDir>/node_modules/',
'<rootDir>/coverage/',
];
const coverage: Config.InitialOptions = {
collectCoverage: false, // enable via --coverage instead
coverageDirectory: '<rootDir>/coverage',
coveragePathIgnorePatterns: pathIgnorePatterns,
coverageReporters: ['lcov', 'text'],
};
// https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-885399102
const typescript: InitialOptionsTsJest = {
globals: {
'ts-jest': {
compiler: 'typescript',
tsconfig: '<rootDir>/tsconfig.base.json',
},
},
};
const config: Config.InitialOptions = {
...coverage,
errorOnDeprecated: true,
injectGlobals: false,
preset: 'ts-jest',
roots: ['<rootDir>/src/'],
testEnvironment: 'node',
testPathIgnorePatterns: pathIgnorePatterns,
...typescript,
};
export default config;