-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
28 lines (27 loc) · 892 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
import { Config, configUmiAlias, createConfig } from '@umijs/max/test';
export default async () => {
return (await configUmiAlias({
...createConfig({
target: 'browser',
jsTransformer: 'esbuild',
// config opts for esbuild , it will pass to esbuild directly
jsTransformerOpts: {
tsx: 'automatic',
jsx: 'automatic',
js: 'automatic',
},
}),
transform: {
'\\.[jt]sx?$': 'babel-jest',
},
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
collectCoverageFrom: [
'src/**/*.{ts,js,tsx,jsx}',
'!src/.umi/**',
'!src/.umi-test/**',
'!src/.umi-production/**',
],
// 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)/)']
})) as Config.InitialOptions;
};