forked from Tencent/tdesign-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
34 lines (32 loc) · 915 Bytes
/
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
import path from 'path';
import { defineConfig } from 'vitest/config';
import { InlineConfig } from 'vitest';
// 单元测试相关配置
const testConfig: InlineConfig = {
include:
process.env.NODE_ENV === 'test-snap'
? ['test/snap/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
: ['src/**/__tests__/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
globals: true,
environment: 'jsdom',
testTimeout: 16000,
transformMode: {
web: [/\.[jt]sx$/],
},
coverage: {
provider: 'istanbul',
exclude: ['src/_common'],
reporter: ['text', 'json', 'html'],
reportsDirectory: 'test/coverage',
},
};
export default defineConfig({
resolve: {
alias: {
'tdesign-react/es': path.resolve(__dirname, './src/'),
'tdesign-react': path.resolve(__dirname, './src/'),
'@test/utils': path.resolve(__dirname, './test/utils'),
},
},
test: testConfig,
});