-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjest.config.js
More file actions
46 lines (43 loc) · 1.19 KB
/
jest.config.js
File metadata and controls
46 lines (43 loc) · 1.19 KB
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
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
const customJestConfig = {
coverageProvider: 'v8',
testEnvironment: './jest.environment.js',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^antd/es/(.*)$': '<rootDir>/node_modules/antd/lib/$1',
uuid: require.resolve('uuid'),
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironmentOptions: {
customExportConditions: [''],
},
transformIgnorePatterns: [
'node_modules/(?!react-hot-toast|@react-sigma/core|graphology|sigma|msw|@mswjs|until-async)',
],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'src/components/**/*.{ts,tsx}',
'src/hooks/**/*.{ts,tsx}',
'src/hoc/**/*.{ts,tsx}',
'src/page/**/*.{ts,tsx}',
'src/lib/**/*.{ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/.next/**',
'!**/coverage/**',
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coverageDirectory: 'coverage',
};
module.exports = createJestConfig(customJestConfig);