-
Notifications
You must be signed in to change notification settings - Fork 70
/
jest.config.js
53 lines (53 loc) · 1.4 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
module.exports = {
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(js|jsx)$': 'babel-jest',
'^.+\\.(svg)$': '<rootDir>/testUtils/svgTransform.js',
'^.+\\.(css|scss)$': '<rootDir>/testUtils/cssTransform.js',
'^.+\\.(png)$': '<rootDir>/testUtils/imageTransform.js',
},
transformIgnorePatterns: ['node_modules/(?!arc)/(?!d3)'],
moduleNameMapper: {
'd3-hexbin': '<rootDir>/node_modules/d3-hexbin/build/d3-hexbin.min.js',
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
},
clearMocks: true,
resetMocks: true,
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!<rootDir>/node_modules/',
'!src/index.js',
'!src/i18n/*',
'!src/setupTests.js',
'!src/setupProxy.js',
'!src/rootReducer.js',
'!src/registerServiceWorker.js',
'!src/containers/shared/images/*',
'!src/containers/test/*',
'!src/coverage/*',
'!testUtils/*',
],
coverageThreshold: {
global: {
branches: 70,
functions: 80,
lines: 80,
statements: 80,
},
},
coverageReporters: ['text', 'text-summary', 'html'],
globals: {
'ts-jest': {
diagnostics: {
warnOnly: true,
},
},
},
}