-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
34 lines (34 loc) · 1.15 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
module.exports = {
verbose: true,
preset: 'ts-jest',
testEnvironment: 'jsdom',
maxWorkers: '80%',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
collectCoverage: true,
collectCoverageFrom: [
'packages/*/src/**/*.{ts,tsx}',
'!packages/*/src/**/style.ts',
'!packages/mmf-shared/src/**/*.{ts,tsx}', // 暂时排除 mmf-shared
],
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
setupFiles: ['<rootDir>/jest-setup.ts'],
setupFilesAfterEnv: ['@testing-library/jest-dom'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
isolatedModules: true,
},
},
moduleNameMapper: {
// '^@fexd/pro-components$': '<rootDir>/packages/components/src/index.tsx',
// '^@fexd/pro-form$': '<rootDir>/packages/form/src/index.tsx',
// '^@fexd/pro-provider$': '<rootDir>/packages/provider/src/index.tsx',
// '^@fexd/pro-table$': '<rootDir>/packages/table/src/index.tsx',
// '^@fexd/pro-utils$': '<rootDir>/packages/utils/src/index.tsx',
'^antd/es': '<rootDir>/node_modules/antd/lib',
'^ahooks/es': '<rootDir>/node_modules/ahooks/lib',
'^rc-field-form/es': '<rootDir>/node_modules/rc-field-form/lib',
},
}