-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
vitest.config.ts
48 lines (44 loc) · 1.37 KB
/
vitest.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { readdirSync } from 'fs';
import { join } from 'path';
import { defineConfig } from 'vitest/config';
const pkgList = readdirSync(join(__dirname, './packages')).filter(
(pkg: string) => pkg.charAt(0) !== '.',
);
const moduleNameMapper = {} as Record<string, any>;
pkgList.forEach((shortName: string) => {
const name = `@ant-design/pro-${shortName}`;
moduleNameMapper[name] = join(__dirname, `./packages/${shortName}/src`);
});
export default defineConfig({
resolve: {
alias: moduleNameMapper,
},
define: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
IS_REACT_ACT_ENVIRONMENT: true,
},
test: {
globals: true,
setupFiles: ['./tests/setupTests.ts'],
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'http://localhost?navTheme=realDark&layout=mix&colorPrimary=techBlue&splitMenus=false&fixedHeader=true',
},
},
coverage: {
provider: 'istanbul',
include: ['packages/**/src/**/*.{ts,tsx}'],
exclude: [
'packages/**/src/**/*.d.ts',
'packages/card/src/components/TabPane/index.tsx',
'packages/**/src/**/typing.ts',
'packages/**/src/demos/**',
'packages/**/src/**/demos/**',
'packages/utils/src/isDeepEqualReact/*.{ts,tsx}',
'packages/utils/src/useMountMergeState/*.{ts,tsx}',
],
},
testTimeout: 60_000,
},
});