-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
52 lines (51 loc) · 1.63 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
50
51
52
module.exports = {
globals: {
__TRANSFORM_HTML__: true,
'ts-jest': {
tsConfig: '<rootDir>/src/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
},
},
transform: {
'^.+\\.(ts|js|html)$': 'babel-jest',
// "^.+\\.jsx?$": "babel-jest",
'^.+\\.(ts|html)$':
'<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
},
testMatch: [
'**/__tests__/**/*.+(ts|js)?(x)',
'**/?(*.)+(spec|test).+(ts|js)?(x)',
],
moduleFileExtensions: ['js', 'json', 'jsx', 'node', 'ts', 'tsx', 'html'],
moduleNameMapper: {
'^src/(.*)$': '<rootDir>/src/$1',
'^app/(.*)$': '<rootDir>/src/app/$1',
'^assets/(.*)$': '<rootDir>/src/assets/$1',
'^environments/(.*)$': '<rootDir>/src/environments/$1',
},
transformIgnorePatterns: ['node_modules/(?!@ngrx)'],
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
],
setupFiles: ['<rootDir>/.jest/register-context.js'],
};
// module.exports = {
// cacheDirectory: './.cache',
// preset: 'jest-preset-angular',
// globals: {
// stringifyContentPathRegex: true,
// 'ts-jest': {
// tsConfig: 'src/tsconfig.spec.json',
// },
// },
// transform: {
// '^.+\\.(ts|js|html)$': 'ts-jest',
// '^.+\\.(ts|html)$':
// '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
// },
// moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', '.html'],
// setupTestFrameworkScriptFile: '<rootDir>/src/setupJest.ts',
// setupFiles: ['<rootDir>/.jest/register-context.js'],
// transformIgnorePatterns: ['node_modules'],
// };