-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjest.config.ts
30 lines (27 loc) · 1.03 KB
/
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 {resolve} from 'path';
import {pathsToModuleNameMapper} from 'ts-jest';
const {compilerOptions} = require(resolve(`./tsconfig.json`));
process.env.TZ = `Europe/Moscow`;
process.env.FORCE_COLOR = `true`;
process.env.TS_JEST_DISABLE_VER_CHECKER = `true`;
module.exports = {
preset: 'jest-preset-angular',
testMatch: ['<rootDir>/**/*.spec.ts'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
globalSetup: 'jest-preset-angular/global-setup',
coverageDirectory: '<rootDir>/../../coverage/demo',
collectCoverageFrom: ['<rootDir>/projects/demo/**/*.ts', '!<rootDir>/**/*.spec.ts'],
coverageReporters: ['html', 'lcov', 'json', 'text', 'lcov', 'clover'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: `<rootDir>/${compilerOptions.baseUrl}/`
.replace(/\.\//g, `/`)
.replace(/\/\/+/g, `/`),
}),
globals: {
'ts-jest': {
tsconfig: resolve(`./tsconfig.json`),
isolatedModules: true,
},
},
verbose: true,
};