-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (41 loc) · 1.04 KB
/
Copy pathvitest.config.ts
File metadata and controls
42 lines (41 loc) · 1.04 KB
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
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
export default defineConfig({
plugins: [vue()],
test: {
globals: true,
environment: 'jsdom',
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/**',
'dist/**',
'**/*.d.ts',
'**/*.config.*',
'**/index.ts',
'src/styles/**',
'src/components/**/*.vue', // 排除 Vue 组件(需要专门的组件测试)
'src/types/**', // 排除类型文件
],
include: ['src/**/*.ts'],
// 暂时禁用覆盖率阈值检查,在 CI 中可以启用
// thresholds: {
// global: {
// branches: 75,
// functions: 75,
// lines: 75,
// statements: 75,
// },
// },
},
setupFiles: ['./src/__tests__/setup.ts'],
include: ['src/**/*.{test,spec}.{js,ts}'],
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
})