Files
EpicNext-Cms/vitest.config.ts
T
Simo 6ed1b03e24
CI / check (push) Successful in 35s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m0s
chore: align Node 26.7.0 toolchain
2026-08-24 19:12:11 +02:00

49 lines
1.3 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",
DATABASE_URL: "mysql://root:root@localhost:3306/test",
},
testTimeout: 10000,
exclude: ["e2e/**", "node_modules/**", ".next/**", ".next.prev/**"],
coverage: {
enabled: true,
provider: "v8",
reporter: ["text", "lcov", "html"],
thresholds: {
statements: 10,
branches: 7,
functions: 9,
lines: 10,
},
include: ["src/**/*.{ts,tsx}"],
exclude: [
"src/generated/**",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/*-client.tsx",
"src/**/*-widget.tsx",
"src/types/**",
"src/test/**",
],
},
},
});