Files
novalon-manage-system/novalon-manage-web/vitest.config.ts
T
张翔 330828f585 test: 修复测试用例并提升测试覆盖率
- 修复 User Journey 测试中的菜单导航和登出问题
- 更新 vitest 配置以包含 role-based-tests
- 修复 role-auth-manager 测试中的 mock 问题
- 测试通过率从 70% 提升到 100%
2026-04-28 16:32:50 +08:00

47 lines
1.0 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath } from 'node:url'
export default defineConfig({
plugins: [vue()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
include: [
'src/__tests__/**/*.{test,spec}.{js,ts,jsx,tsx}',
'src/role-based-tests/**/*.{test,spec}.{js,ts,jsx,tsx}'
],
// 明确排除E2E测试文件
exclude: [
'node_modules/',
'dist/',
'e2e/**/*.spec.ts',
'**/*.d.ts',
'**/*.config.*',
'**/mockData',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
exclude: [
'node_modules/',
'src/__tests__/',
'**/*.d.ts',
'**/*.config.*',
'**/mockData',
'e2e/',
],
lines: 80,
functions: 80,
branches: 80,
statements: 80,
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})