-
Notifications
You must be signed in to change notification settings - Fork 160
/
jest.config.js
39 lines (39 loc) · 1.09 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
module.exports = {
testRegex: './*\\.test\\.tsx?$',
setupFilesAfterEnv: ['./tst/setupTests.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx', 'node'],
transform: {
'\\.tsx?$': 'ts-jest',
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx'
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
},
testPathIgnorePatterns: ['node_modules', '/tst/snapshots/',],
testEnvironment: 'jsdom',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.tsx', '!src/**/*.stories.tsx'],
coveragePathIgnorePatterns: [
'/src/providers/*',
'/src/components/sdk/*',
'/src/hooks/sdk/*'
],
coverageReporters: ['text-summary', 'lcov', 'json', 'clover'],
coverageDirectory: 'coverage',
coverageThreshold: {
global: {
statements: 89,
branches: 59,
functions: 73,
lines: 90
}
},
/**
* Use v8 to avoid installing three explicit babel dependencies to solve below bug:
* https://github.com/facebook/jest/issues/12925
* https://jestjs.io/docs/configuration#coverageprovider-string
*/
coverageProvider: 'v8',
};