-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
77 lines (75 loc) · 3.14 KB
/
Copy pathjest.config.js
File metadata and controls
77 lines (75 loc) · 3.14 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const path = require('path');
globalThis.ngJest = {
skipNgcc: true,
tsconfig: './tsconfig.spec.json',
};
module.exports = {
preset: 'jest-preset-angular',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['./src/setup.jest.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
},
},
transform: {
'^.+\\.ts$': 'ts-jest',
},
moduleNameMapper: {
'^@ws-widget/collection/(.*)$': path.resolve(__dirname, 'src/library/ws-widget/collection/$1'),
'^@ws-widget/collection$': path.resolve(__dirname, 'src/library/ws-widget/collection'),
'^@ws-widget/utils/(.*)$': path.resolve(__dirname, 'src/library/ws-widget/utils/$1'),
'^@ws-widget/utils$': path.resolve(__dirname, 'src/library/ws-widget/utils'),
'^@ws-widget/resolver/(.*)$': path.resolve(__dirname, 'src/library/ws-widget/resolver/$1'),
'^@ws-widget/resolver$': path.resolve(__dirname, 'src/library/ws-widget/resolver'),
'^sunbird-sdk': path.resolve(__dirname, 'node_modules/@project-sunbird/sunbird-sdk'),
'^sunbird-sdk/(.*)$': path.resolve(__dirname, 'node_modules/@project-sunbird/sunbird-sdk/$1'),
"^aastrika_npmjs/comptency": "<rootDir>/node_modules/@aastrika_npmjs/comptency",
"^aastrika_npmjs/comptency/(.*)$": "<rootDir>/node_modules/@aastrika_npmjs/comptency/$1",
"^aastrika_npmjs/discussions-ui-v8": "<rootDir>/node_modules/@aastrika_npmjs/discussions-ui-v8",
"^aastrika_npmjs/discussions-ui-v8/(.*)$": "<rootDir>/node_modules/@aastrika_npmjs/discussions-ui-v8/$1",
'^@ws/author/(.*)$': '<rootDir>/src/project/ws/author/$1',
'^@ws/author$': '<rootDir>/src/project/ws/author',
'^@ws/app/(.*)$': '<rootDir>/src/project/ws/app/$1',
'^@ws/app$': '<rootDir>/src/project/ws/app',
},
testPathIgnorePatterns: [
'/node_modules/',
'.*\\.data\\.spec\\.ts$',
'.*\\.spec\\.data\\.ts$',
'src/__tests__ ',
'regexp-polyfill.min.js '
],
testMatch: ['**/?(*.)(spec).ts'],
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx', 'html', 'mjs', 'd.ts'],
transformIgnorePatterns: ['/node_modules/(?!flat)/'],
collectCoverage: true,
coverageDirectory: '<rootDir>/coverage/',
coverageReporters: ['html', 'text', 'lcov', 'json', 'json-summary', 'cobertura'],
moduleDirectories: ['node_modules', 'src'],
setupFiles: [
"<rootDir>/src/__tests__/setup.js"
],
fakeTimers: {
enableGlobally: true,
},
coveragePathIgnorePatterns: [
path.resolve(__dirname, 'src/app/*/*.module.ts'),
path.resolve(__dirname, 'src/app/animations/*.ts'),
path.resolve(__dirname, 'src/app/manage-learn/'),
path.resolve(__dirname, 'src/library/ws-widget'),
path.resolve(__dirname, 'src/app/components/popups'),
path.resolve(__dirname, 'src/guards'),
path.resolve(__dirname, 'src/pipes'),
path.resolve(__dirname, 'src/services'),
path.resolve(__dirname, 'src/app/services'),
'src/__tests__ ',
'regexp-polyfill.min.js '
],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};