-
Notifications
You must be signed in to change notification settings - Fork 11
/
jest.config.js
49 lines (46 loc) · 1.29 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
42
43
44
45
46
47
48
49
const { pathsToModuleNameMapper } = require('ts-jest');
const { paths } = require('./tsconfig.json').compilerOptions;
process.env.TZ = 'UTC'; // Tests should always run in UTC, no time zone dependencies
// eslint-disable-next-line no-undef
globalThis.ngJest = {
skipNgcc: true,
tsconfig: 'tsconfig.spec.json',
};
module.exports = {
rootDir: '.',
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'test-results/hypertrace-ui',
},
],
[
'jest-html-reporter',
{
outputPath: 'test-results/hypertrace-ui/test-report.html',
},
],
],
watchPathIgnorePatterns: ['test-results'],
collectCoverageFrom: [
'src/**/*.ts',
'projects/!(test-utils)/src/**/*.ts',
'!**/*.d.ts',
'!src/main.ts',
'!src/environments/**',
'!**/*/test/**',
'!src/app/routes/**/*.ts',
],
coverageDirectory: 'coverage/hypertrace-ui',
modulePathIgnorePatterns: ['<rootDir>/dist/'], // Need to reset from app project, but empty is merged
testMatch: ['<rootDir>/(src|projects)/**/+(*.)+(spec|test).ts'],
moduleNameMapper: {
'^lodash-es$': 'lodash',
'^uuid$': 'uuid',
...pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }),
},
};