Files
EpicNext-Cms/vitest.config.ts
T
openhands 423a33200e
CI / check (push) Failing after 14s
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 2m38s
chore: improve tooling, linting, testing, and CI
- Add LICENSE file (CC BY-NC-SA 4.0)
- Add .nvmrc pinning Node 22
- Add Renovate config with daily schedule and Gitea Actions workflow
- Reduce ESLint max-warnings from 1000 to 50
- Re-enable Biome a11y/security recommended rules
- Fix Biome lint issues (a11y, hook deps, SVG labels, checkbox semantics)
- Improve CI: run on pushes to feat/fix branches, add pnpm audit
- Add Vitest coverage with v8 provider and thresholds
- Add E2E tests (auth, admin, navigation specs)
- Add admin-maintenance server action test
- Install @vitest/coverage-v8
- Ignore coverage/ directory
2026-07-27 17:03:09 +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/**"],
coverage: {
enabled: true,
provider: "v8",
reporter: ["text", "lcov", "html"],
thresholds: {
statements: 5,
branches: 3,
functions: 4,
lines: 5,
},
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/generated/**",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/types/**",
"src/test/**",
],
},
},
});