-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
jest-project.spec.ts.snap
92 lines (86 loc) · 2.52 KB
/
jest-project.spec.ts.snap
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`jestProject --babelJest should generate proper jest.transform when --compiler=swc and supportTsx is true 1`] = `
"module.exports = {
displayName: 'lib1',
preset: '../../jest.preset.ts',
transform: {
'^.+\\\\\\\\.[tj]sx?$': ['@swc/jest', { jsc: { transform: { react: { runtime: 'automatic' } } } }]
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/lib1'
};
"
`;
exports[`jestProject --babelJest should generate proper jest.transform when babelJest and supportTsx is true 1`] = `
"module.exports = {
displayName: 'lib1',
preset: '../../jest.preset.ts',
transform: {
'^.+\\\\\\\\.[tj]sx?$': 'babel-jest'
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/lib1'
};
"
`;
exports[`jestProject --babelJest should generate proper jest.transform when babelJest is true 1`] = `
"module.exports = {
displayName: 'lib1',
preset: '../../jest.preset.ts',
transform: {
'^.+\\\\\\\\.[tj]s$': 'babel-jest'
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/libs/lib1'
};
"
`;
exports[`jestProject --setup-file should have setupFilesAfterEnv and globals.ts-jest in the jest.config when generated for angular 1`] = `
"module.exports = {
displayName: 'lib1',
preset: '../../jest.preset.ts',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\\\\\\\.(html|svg)$',
}
},
coverageDirectory: '../../coverage/libs/lib1',
transform: {
'^.+\\\\\\\\.(ts|mjs|js|html)$': 'jest-preset-angular'
},
transformIgnorePatterns: ['node_modules/(?!.*\\\\\\\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
]
};
"
`;
exports[`jestProject should create a jest.config.ts 1`] = `
"module.exports = {
displayName: 'lib1',
preset: '../../jest.preset.ts',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
}
},
coverageDirectory: '../../coverage/libs/lib1'
};
"
`;
exports[`jestProject should use jest.config.js in project config with --js flag 1`] = `
Object {
"executor": "@nrwl/jest:jest",
"options": Object {
"jestConfig": "libs/lib1/jest.config.js",
"passWithNoTests": true,
},
"outputs": Array [
"coverage/libs/lib1",
],
}
`;