-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathjest.config.js
54 lines (47 loc) · 1.49 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
const _baseConfig = (project, testExtension) => ({
displayName: project,
roots: ['<rootDir>'],
moduleNameMapper: {
"^testsutil(/.+)?": "<rootDir>/testsutil$1"
},
testMatch: [`**/*.test.${testExtension}`],
testPathIgnorePatterns: ['/node_modules/', '/e2e/'],
transform: {
'^.+\\.(js|ts|tsx)$': [
'ts-jest',
{
tsconfig: project === 'react' ? ({ esModuleInterop: true }) : false,
isolatedModules: project === 'react',
},
],
'^.+\\.(css|styl|less|sass|scss)$': 'jest-css-modules-transform',
},
transformIgnorePatterns: ['/node_modules/(?!(@vscode/webview-ui-toolkit/|@microsoft/|exenv-es6/|@atlaskit/))'],
collectCoverage: true,
collectCoverageFrom: [
`src/**/*.${testExtension}`,
'!src/**/*.d.ts',
'!src/**/*.{spec,test}.{ts,tsx,js,jsx}', // Exclude test files
],
coverageDirectory: `coverage/${project}`,
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
coverageThreshold: {
global: testExtension === 'ts' ? {
statements: 22,
branches: 8,
functions: 9,
lines: 22,
} : /* tsx */{
statements: 5,
branches: 4,
functions: 4,
lines: 5,
},
},
});
module.exports = {
projects: ['<rootDir>/jest.*.config.js'],
verbose: true,
// custom exports for individual projects
_baseConfig,
};