-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
42 lines (36 loc) · 1.36 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
31
32
33
34
35
36
37
38
39
40
41
42
import {resolve} from 'node:path';
import type {Config} from 'jest';
import {pathsToModuleNameMapper} from 'ts-jest';
process.env.TZ = 'Europe/Moscow';
process.env.FORCE_COLOR = 'true';
process.env.TS_JEST_DISABLE_VER_CHECKER = 'true';
const {compilerOptions} = require(resolve(__dirname, 'tsconfig.json'));
process.env.TZ = 'Europe/Moscow';
process.env.FORCE_COLOR = 'true';
process.env.TS_JEST_DISABLE_VER_CHECKER = 'true';
const config: Config = {
rootDir: __dirname,
preset: 'jest-preset-angular',
testEnvironment: 'jsdom',
globals: {
'ts-jest': {
tsconfig: resolve(__dirname, 'tsconfig.json'),
isolatedModules: true,
},
},
extensionsToTreatAsEsm: ['.ts'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
modulePathIgnorePatterns: ['dist'],
transform: {'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular'},
testMatch: ['<rootDir>/**/*.spec.ts'],
coverageDirectory: '<rootDir>/coverage/demo',
collectCoverageFrom: ['<rootDir>/projects/demo/**/*.ts', '!<rootDir>/**/*.spec.ts'],
coverageReporters: ['html', 'lcov', 'json', 'text', 'lcov'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: `<rootDir>/${compilerOptions.baseUrl}/`
.replaceAll('./', '/')
.replaceAll(/\/\/+/g, '/'),
}),
verbose: true,
};
export default config;