2026-06-11 18:30:02 +00:00
|
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
// Native tsconfig path resolution (replaces vite-tsconfig-paths in Vite 5+/Vitest 2+).
|
|
|
|
|
resolve: {
|
|
|
|
|
tsconfigPaths: true,
|
|
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
// jsdom covers the few client-helper modules we test (auth-provider, csv export, etc.)
|
|
|
|
|
// Server-side unit tests don't depend on the DOM.
|
|
|
|
|
environment: "jsdom",
|
|
|
|
|
globals: false,
|
|
|
|
|
include: [
|
|
|
|
|
"src/**/*.{test,spec}.{ts,tsx}",
|
|
|
|
|
],
|
|
|
|
|
// Exclude Playwright E2E specs from Vitest.
|
|
|
|
|
exclude: [
|
|
|
|
|
"node_modules/**",
|
|
|
|
|
".next/**",
|
|
|
|
|
"e2e/**",
|
|
|
|
|
"playwright-report/**",
|
|
|
|
|
"test-results/**",
|
|
|
|
|
],
|
2026-07-07 23:35:00 +00:00
|
|
|
setupFiles: ["./src/test-setup.ts"],
|
2026-06-11 18:30:02 +00:00
|
|
|
},
|
|
|
|
|
});
|