mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-27 22:45:03 +00:00
The scenario-metrics route test now imports a module chain (route → overlay.ts) that carries `import "server-only"`, which Vite can't resolve to a Node entry. Alias it to an empty stub so the guard stays in app code while Node-env tests load. Full suite: 600 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
732 B
TypeScript
23 lines
732 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig({
|
|
esbuild: {
|
|
jsx: "automatic",
|
|
},
|
|
test: {
|
|
environment: "node",
|
|
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
|
|
// Cypress lives under /cypress and uses its own runner; exclude it so the
|
|
// two harnesses do not collide.
|
|
exclude: ["node_modules", ".next", "cypress"],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
// `server-only` is a marker package with no Node-resolvable entry under
|
|
// Vite; stub it so tests that import a server module chain still load.
|
|
"server-only": path.resolve(__dirname, "./vitest/server-only-stub.ts"),
|
|
},
|
|
},
|
|
});
|