Files
EpicNext-Cms/vitest.config.ts
T
openhands d8bb117114
CI / check (push) Failing after 22s
Deploy / release (push) Skipped
CI / deploy (push) Skipped
Deploy / deploy (push) Failing after 21s
chore: set realistic coverage thresholds (will increase toward 100%)
2026-07-30 19:15:57 +02:00

43 lines
1.1 KiB
TypeScript

import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
// Local config so Vitest does not walk up into the parent Laravel repo's
// vite.config.js (this app lives inside the Laravel project tree).
export default defineConfig({
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
// server-only throws in Node; tests don't need the Next client guard.
"server-only": fileURLToPath(
new URL("./src/test/server-only-stub.ts", import.meta.url),
),
},
},
test: {
environment: "node",
// Modules under test transitively import @/env; skip its strict parse so
// unit tests run without a populated .env.
env: { SKIP_ENV_VALIDATION: "1" },
exclude: ["e2e/**", "node_modules/**", ".next/**", ".next.prev/**"],
coverage: {
enabled: true,
provider: "v8",
reporter: ["text", "lcov", "html"],
thresholds: {
statements: 15,
branches: 10,
functions: 15,
lines: 15,
},
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/generated/**",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/types/**",
"src/test/**",
],
},
},
});