-
Notifications
You must be signed in to change notification settings - Fork 11
/
jest.config.js
32 lines (31 loc) · 1.12 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
// weird issue with Jest after updating to Angular ver 14:
// https://github.com/nrwl/nx/issues/7844#issuecomment-1139427677
const esModules = ['@angular', 'tslib', 'rxjs'].join('|');
module.exports = {
preset: 'jest-preset-angular',
// verbose: true,
roots: ['projects'],
restoreMocks: true,
rootDir: './',
modulePaths: ['<rootDir>'],
modulePathIgnorePatterns: ['^.+\\.js$'],
testEnvironment: 'jsdom',
testMatch: ['**/?(*.)+(spec).ts?(x)'],
transform: {
'^.+\\.(ts|js|html)$': ['jest-preset-angular', {
tsconfig: '<rootDir>/tsconfig.spec.json',
allowSyntheticDefaultImports: true,
diagnostics: { warnOnly: true },
stringifyContentPathRegex: '\\.html$',
}],
},
moduleNameMapper: {
'^@sq-ui/ng-sq-common/(.*)$': '<rootDir>/projects/ng-sq-common/src/$1',
'@sq-ui/ng-sq-common': '<rootDir>/projects/ng-sq-common/src/index.ts',
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
transformIgnorePatterns: [`<rootDir>/node_modules/(?!.*\\.mjs$|${esModules})`],
coverageReporters: ["lcov", "text"],
};