-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
61 lines (60 loc) · 1.73 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
53
54
55
56
57
58
59
60
61
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
moduleNameMapper: {
'\\.(gif|ttf|eot|svg)$': '<rootDir>/jest/fileMock.js',
'^xp-styled-components$': '<rootDir>/src/themes/styledComponents.ts',
'^xp-common/(.*)$': '<rootDir>/src/common/$1',
'^xp-pages/(.*)$': '<rootDir>/src/pages/$1',
'^xp-data/(.*)$': '<rootDir>/src/data/$1',
'^xp-resources/(.*)': '<rootDir>/src/resources/$1',
'^xp-session/(.*)$': '<rootDir>/src/session/$1',
'^xp-themes/(.*)$': '<rootDir>/src/themes/$1',
'^xp-utility/(.*)$': '<rootDir>/src/utility/$1',
'^xp-testUtils/(.*)$': '<rootDir>/src/testingUtils/$1',
'^xp-src/(.*)$': '<rootDir>/src/$1',
},
// globals: {
// 'ts-jest': {
// babelConfig: { env: { test: { plugins: ['dynamic-import-node'] } } },
// },
// },
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
snapshotSerializers: ['enzyme-to-json/serializer'],
setupFilesAfterEnv: ['<rootDir>/jest/setupJest.ts'],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.js',
'src/**/*.jsx',
'!src/themes/**',
'!src/**/Styled*.tsx',
'!src/**/Styled*.ts',
'!src/**/*Actions.ts',
'!src/mainStore.ts',
'!src/App.tsx',
'!src/AppView.tsx',
'!src/StyledAppComponents.tsx',
'!src/index.tsx',
'src/utility/redux/*.ts',
],
coverageReporters: ['text-summary', 'html'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
'src/common/**': {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
},
};