import path from "node:path"; import { defineConfig } from "vitest/config"; const alias = { "@": path.resolve(__dirname, ".") }; // Two projects in one run: pure logic keeps the node environment, component // tests get jsdom. Splitting them keeps the ~100 logic tests from paying for // a DOM they never touch. export default defineConfig({ test: { projects: [ { resolve: { alias }, test: { name: "unit", environment: "node", include: ["tests/unit/**/*.test.ts"] }, }, { resolve: { alias }, test: { name: "components", environment: "jsdom", setupFiles: ["tests/components/setup.ts"], include: ["tests/components/**/*.test.tsx"], }, }, ], }, });