mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-05 16:09:27 +08:00
- 补装 @vitest/coverage-v8(此前 npm run test:coverage 缺少依赖无法运行) - 阈值略低于当前覆盖率:语句 70%、分支 65%、函数 75%、行 70% - CI 在任务摘要中显示覆盖率并上传报告 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1009 B
TypeScript
31 lines
1009 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
include: ['src/__tests__/**/*.test.ts', 'src/__tests__/**/*.test.tsx'],
|
|
exclude: ['node_modules', '.next', 'dist'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'json-summary', 'html'],
|
|
include: ['src/lib/**/*.ts', 'src/app/api/**/*.ts'],
|
|
exclude: ['src/__tests__/**', 'node_modules/**'],
|
|
// 略低于当前覆盖率,防止覆盖率下降;补充测试后可逐步提高
|
|
thresholds: {
|
|
statements: 70,
|
|
branches: 65,
|
|
functions: 75,
|
|
lines: 70,
|
|
},
|
|
},
|
|
},
|
|
})
|