-
Notifications
You must be signed in to change notification settings - Fork 4
/
jest.config.js
36 lines (36 loc) · 1001 Bytes
/
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
module.exports = {
clearMocks: true,
preset: 'ts-jest/presets/js-with-ts-esm',
modulePathIgnorePatterns: ['<rootDir>/package.json'],
moduleDirectories: ['node_modules', 'src'],
coverageDirectory: 'coverage',
moduleFileExtensions: ['tsx', 'ts', 'js'],
collectCoverageFrom: [
'src/**/*.{js,ts,tsx}',
'!src/**/*.d.ts',
'!src/.umi/**/*',
'!src/.umi-production/**/*',
'!src/locale/**/*',
],
testMatch: ['**/__tests__/**/*.test.+(tsx|ts)'],
globals: {
'ts-jest': {
babelConfig: true,
tsconfig: 'tsconfig-jest.json',
diagnostics: false,
isolatedModules: true,
useESM: true,
},
},
testEnvironment: 'jsdom',
moduleNameMapper: {
'src/(.*)': '<rootDir>/src/$1',
'\\.(css|less|scss)$': 'identity-obj-proxy',
},
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
},
setupFilesAfterEnv: ['<rootDir>/__tests__/extend-expect.ts'],
setupFiles: ['<rootDir>/__tests__/setupJest.ts'],
// transformIgnorePatterns: [],
};