Files
Epicnabbo-Catalogus-Updated…/vitest.config.ts
T
openhands 750fcb2e5c refactor: resolve hotel name directly from HOTEL_NAME env
resolveHotelName() now returns env.HOTEL_NAME directly — the single source
of truth. The CMS hotel_name site setting and its DEFAULTS entry are removed
as dead code since they no longer influence the displayed name.

Call sites are unchanged (still await resolveHotelName()); only the lookup
behind it is gone, so the public site always shows the configured env name
with no DB round-trip and no preset.
2026-08-27 16:42:12 +02:00

50 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",
HOTEL_NAME: "TestHotel",
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/**",
],
},
},
});