forked from nestjsx/crud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
41 lines (40 loc) · 1.02 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
const tsconfig = require('tsconfig-extends');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const compilerOptions = tsconfig.load_file_sync('./tsconfig.jest.json', __dirname);
module.exports = {
setupFilesAfterEnv: ['jest-extended'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/packages/',
}),
moduleFileExtensions: ['ts', 'js'],
testRegex: '\\.spec.ts$',
rootDir: '.',
transform: {
'^.+\\.ts$': 'ts-jest',
},
globals: {
'ts-jest': {
tsConfig: 'tsconfig.jest.json',
},
},
coverageReporters: ['json', 'lcov', 'text-summary'],
coverageDirectory: 'coverage',
collectCoverageFrom: [
'packages/**/*.ts',
'!packages/**/*.d.ts',
'!packages/**/index.ts',
'!packages/**/*.interface.ts',
'!**/node_modules/**',
'!**/__stubs__/**',
'!**/__fixture__/**',
'!integration/*',
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
};