-
Notifications
You must be signed in to change notification settings - Fork 304
/
index.js
47 lines (45 loc) · 1.1 KB
/
index.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
const snapshotSerializers = require('../build/serializers');
const basePreset = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
},
},
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
},
moduleFileExtensions: ['ts', 'html', 'js', 'json'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^app/(.*)$': '<rootDir>/src/app/$1',
'^assets/(.*)$': '<rootDir>/src/assets/$1',
'^environments/(.*)$': '<rootDir>/src/environments/$1',
},
snapshotSerializers,
}
module.exports = {
get defaults() {
return basePreset;
},
get defaultsESM() {
return {
...basePreset,
extensionsToTreatAsEsm: ['.ts'],
globals: {
'ts-jest': {
...basePreset.globals['ts-jest'],
useESM: true,
},
},
moduleNameMapper: {
...basePreset.moduleNameMapper,
'tslib': '<rootDir>/node_modules/tslib/tslib.es6.js',
},
transformIgnorePatterns: [
'node_modules/(?!tslib)',
],
}
},
}