-
Notifications
You must be signed in to change notification settings - Fork 86
/
jest.config.js
41 lines (39 loc) · 1.14 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
const esModules = ['@agm', 'ngx-bootstrap', 'lodash-es'].join('|');
const config = {
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
modulePaths: ['core'],
setupFilesAfterEnv: ['./scripts/setupTest.ts', 'jest-canvas-mock'],
globalSetup: './scripts/setupGlobalJest.ts',
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
// snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jest-environment-jsdom-fifteen',
collectCoverage: true,
coverageReporters: ['json', 'lcov', 'text', 'text-summary', 'html'],
verbose: true,
collectCoverageFrom: [
'core/**/*.{ts,tsx}',
'!core/components/css-utilities/**',
'!core/utils/**',
'!**/dist/**/*',
'!**/__stories__/**/*',
'!**/*.story.tsx',
'!core/*.type.tsx',
'!core/*.d.ts',
],
globals: {
window: true,
timers: 'fake',
'ts-jest': {
diagnostics: false,
},
},
moduleNameMapper: {
'@/(.*)$': '<rootDir>/core/$1',
'\\.svg$': '<rootDir>/__mocks__/fileMock.js',
},
};
module.exports = config;