import path from "node:path"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vitest/config"; export default defineConfig({ plugins: [react()], resolve: { // Mirror tsconfig.json `paths` so tests can import via `@/*`. alias: { "@": path.resolve(__dirname, "./app"), }, }, test: { // happy-dom is required for any test that mounts a React tree. environment: "happy-dom", // Inline @raredays/* sources so vitest doesn't choke on ESM-internal // package paths when components import from sibling subpath exports. server: { deps: { inline: [/@raredays\//], }, }, include: ["app/**/*.test.ts", "app/**/*.test.tsx", "lib/**/*.test.ts"], setupFiles: ["./vitest.setup.ts"], env: { MOCKS: "on" }, }, });