-
Notifications
You must be signed in to change notification settings - Fork 309
/
index.js
41 lines (39 loc) · 1003 Bytes
/
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
const snapshotSerializers = require('../build/serializers');
const basePreset = {
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
resolver: 'jest-preset-angular/build/resolvers/ng-jest-resolver.js',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'html', 'js', 'json'],
snapshotSerializers,
};
module.exports = {
defaults: {
...basePreset,
transformIgnorePatterns: ['node_modules/(?!@angular)'],
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular',
},
},
defaultsESM: {
...basePreset,
extensionsToTreatAsEsm: ['.ts'],
globals: {
'ts-jest': {
...basePreset.globals['ts-jest'],
useESM: true,
},
},
moduleNameMapper: {
tslib: 'tslib/tslib.es6.js',
},
transform: {
'^.+\\.(ts|js|html|svg)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!tslib)'],
},
};