-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
30 lines (28 loc) · 869 Bytes
/
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
/**
* Created by glenn on 13.08.19.
*/
const esModules = ['@ngrx', 'angular2-ui-switch', 'ng-dynamic', 'lodash-es'].join('|');
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/src/testing/setup-jest.ts'],
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: ['jest-preset-angular/InlineHtmlStripStylesTransformer']
}
},
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
transform: {
'^.+\\.(ts|html)$': 'ts-jest',
'^.+\\.js$': '<rootDir>/src/testing/babel-jest-wrapper.js'
},
testPathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/out-tsc/',
'<rootDir>/node_modules/'
],
moduleNameMapper: {
'@angular/common/locales/(.*).js': '<rootDir>/src/testing/__mocks__/file-mock.js'
}
};