-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.base.config.js
59 lines (58 loc) · 1.77 KB
/
jest.base.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
50
51
52
53
54
55
56
57
58
module.exports = {
clearMocks: true,
collectCoverageFrom: [
'projects/library/**/!(index|public-api|*.module|*.interface|*.constant|*.mock|*.d).ts',
'projects/library/**/*.directive.ts',
'!projects/library/**/testing/**',
],
coverageDirectory: '<rootDir>/coverage/',
globals: {
'ts-jest': {
tsConfig: 'projects/library/tsconfig.spec.json',
ignoreCoverageForAllDecorators: true,
diagnostics: false,
stringifyContentPathRegex: '\\.html$',
astTransformers: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
],
},
},
moduleFileExtensions: [
'ts',
'js',
'html',
],
moduleNameMapper: {
'app/(.*)': '<rootDir>/projects/demo/app/$1',
'assets/(.*)': '<rootDir>/projects/demo/assets/$1',
'environments/(.*)': '<rootDir>/projects/demo/environments/$1',
'^@terminus/ui(.*)$': '<rootDir>/projects/library$1/src/public-api.ts',
'^@terminus/ui(.*)/testing$': '<rootDir>/projects/library$1/testing/src/public-api.ts',
},
preset: 'jest-preset-angular',
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '<rootDir>/coverage/junit/',
outputName: 'report.xml',
},
],
],
setupFilesAfterEnv: ['<rootDir>/tooling/jest-setup.ts'],
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js',
],
testMatch: [
'<rootDir>/**/?(*.)spec.ts?(x)',
'<rootDir>/**/?(*.)test-sass.js?(x)',
],
transform: { '^.+\\.(ts|js|html)$': 'ts-jest' },
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!@ngrx|popper)',
],
};