Files
2026-07-09 14:32:36 +00:00

34 lines
933 B
TypeScript

/// <reference types="vitest" />
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import path from "path";
/**
* Standalone Vitest config — kept separate from ``vite.config.ts`` so:
* 1. The PWA plugin and SPA build tweaks don't run for unit tests
* (they pull heavy deps and slow startup by ~3 s).
* 2. We can keep ``test.environment`` / ``setupFiles`` in one obvious
* place without polluting the prod build config.
*/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
css: false,
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
pool: "threads",
coverage: {
provider: "v8",
reporter: ["text", "html"],
include: ["src/pages/Agent/Memory/**"],
},
},
});