Files
NextEdu/vitest.config.ts
SpecialX 48829bd02b chore(config): update vitest config, add vercel.json and manifest
- Update vitest.config.ts

- Add vercel.json for deployment configuration

- Add PWA manifest
2026-07-03 10:23:13 +08:00

34 lines
876 B
TypeScript

import path from "node:path"
import { defineConfig } from "vitest/config"
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
// 测试环境跳过 server-only 守卫(生产环境阻止客户端导入服务端模块)
"server-only": path.resolve(__dirname, "tests/setup/empty-stub.ts"),
},
},
test: {
name: "integration",
environment: "node",
include: ["tests/integration/**/*.test.ts"],
setupFiles: ["tests/setup/integration.setup.ts"],
clearMocks: true,
restoreMocks: true,
mockReset: true,
coverage: {
provider: "v8",
enabled: false,
reporter: ["text", "html", "lcov"],
reportsDirectory: "./coverage/integration",
thresholds: {
lines: 80,
functions: 80,
branches: 75,
statements: 80,
},
},
},
})