generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathjest.config.ts
30 lines (27 loc) · 956 Bytes
/
jest.config.ts
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
import { Config, createConfig } from '@umijs/test';
const base = createConfig({
target: 'browser',
jsTransformer: 'esbuild',
// config opts for esbuild , it will pass to esbuild directly
jsTransformerOpts: { jsx: 'automatic' },
});
const config: Config.InitialOptions = {
...base,
setupFilesAfterEnv: ['<rootDir>/tests/jest-setup.ts'],
collectCoverageFrom: [
'src/**/*.{ts,js,tsx,jsx}',
'!src/.umi/**',
'!src/.umi-test/**',
'!src/.umi-production/**',
],
moduleNameMapper: {
'antd-style/(.*)$': '<rootDir>/src/$1',
'antd-style': '<rootDir>/src',
'@/(.*)$': '<rootDir>/src/$1',
},
/* if needed other snapshotSerializers should go here */
snapshotSerializers: ['@emotion/jest/serializer'],
// if you require some es-module npm package, please uncomment below line and insert your package name
// transformIgnorePatterns: ['node_modules/(?!.*(lodash-es|your-es-pkg-name)/)']
};
export default config;