import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; // Unit tests cover the pure logic in lib/ only (docs/rewrite-plan.md, Q10), so // a plain Node environment is enough - no DOM, no React. // // TZ is pinned to somewhere that is *not* Europe/Berlin on purpose: the date // code must produce Berlin wall times regardless of the machine it runs on, // and a test run in Berlin would hide exactly that class of bug. export default defineConfig({ test: { environment: "node", include: ["**/*.test.ts"], exclude: ["node_modules/**", ".next/**"], passWithNoTests: true, env: { TZ: "America/New_York", // lib/env.ts throws without these; the values are never contacted - api.test.ts stubs fetch. NEXT_PUBLIC_API_BASE_URL: "https://api.test", NEXT_PUBLIC_ADMIN_APP_URL: "https://admin.test", }, }, resolve: { alias: { "@": fileURLToPath(new URL(".", import.meta.url)) }, }, });