-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.unit.config.js
38 lines (38 loc) · 1.11 KB
/
jest.unit.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
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts', 'tsx'],
moduleDirectories: ['node_modules', 'src'],
moduleNameMapper: {
'\\.(jpg|ico|jpeg|png|gif|svg|css)$': '<rootDir>/__mocks__/fileMock.js',
},
roots: ['<rootDir>'],
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
testMatch: ['**/?(*.)+(unit).ts?(x)'],
testPathIgnorePatterns: ['/node_modules/', '/generator/', 'src/illustrations/', 'src/icons/', '/static/'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx',
},
transformIgnorePatterns: ['/node_modules/'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts?(x)', '!**/*.visual.ts?(x)'],
cacheDirectory: '/tmp/jest',
coveragePathIgnorePatterns: [
'src/illustrations',
'src/icons',
'src/theme',
'src/storybook',
'generator',
'src/shared/PreviewGallery',
'src/contexts',
],
coverageReporters: ['text-summary', 'html'],
coverageDirectory: 'coverage',
coverageThreshold: {
global: {
statements: 100,
functions: 100,
lines: 100,
},
},
};