Files
HealthLog/vitest.config.mts
T
Marc-André Bombeck 25f41f88fe feat(ux,settings): undo where it was missing and settings that behave one way
Deleting a measurement or mood entry can be undone from the toast via
new restore endpoints, dialogs submit on enter with busy states, silent
mutations gain error toasts, and the settings area finishes its
consolidation: provider and integration cards live in focused
subcomponents, every setting persists server-side at exactly one home,
and the save conventions are written down. The remaining raw fetches in
settings move onto the shared client.
2026-06-11 02:19:28 +02:00

50 lines
1.6 KiB
TypeScript

import { defineConfig } from "vitest/config";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
test: {
globals: true,
environment: "node",
// Primes the i18n locale cache so provider mounts resolve every
// locale synchronously (production gets the active bundle as an RSC
// prop instead — see src/lib/i18n/load-locale.ts).
setupFiles: ["./vitest.setup.ts"],
// Default `pnpm test` keeps unit tests only — integration suite uses
// testcontainers and runs separately via `pnpm test:integration`.
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/.next/**",
"tests/integration/**",
// Playwright E2E suite — driven separately via `pnpm e2e`.
"e2e/**",
// Live agent worktrees create copies of `src/` under
// `.claude/worktrees/`; vitest would otherwise pick those copies up
// and run their tests twice — possibly against stale snapshots.
".claude/worktrees/**",
],
coverage: {
provider: "v8",
// `include` enumerates the full source tree so the report shows
// per-file coverage for files never imported by a test (vitest 4
// dropped the `coverage.all` flag and uses `include` for this).
include: ["src/**/*.ts", "src/**/*.tsx"],
exclude: [
"src/generated/**",
"src/**/__tests__/**",
"src/**/*.test.ts",
"src/**/*.test.tsx",
],
},
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
});