Files
workspace/code/fms/fms-vue/vitest.config.js
T
2026-08-19 17:32:25 +08:00

34 lines
936 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./tests/setup.js'],
css: false,
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
// 只统计源码,排除入口、主题预设等纯常量文件
include: ['src/**/*.{js,vue}'],
exclude: ['src/main.js', 'src/theme/presets.js'],
// 60% 起步门槛:AI 全权测试时用 pnpm test:coverage 检查缺口;
// 普通 pnpm test 不应用阈值(vitest 仅在 --coverage 下检查 thresholds)
thresholds: {
lines: 60,
functions: 60,
branches: 60,
statements: 60,
},
},
},
})