2026-09-16 07:37:43 +00:00
|
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
|
import path from "node:path";
|
2026-09-16 13:19:32 +00:00
|
|
|
import { fileURLToPath } from "node:url";
|
2026-09-16 07:37:43 +00:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: { "@": path.resolve(__dirname, "./src") },
|
|
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
resolve: { alias: { "@": path.resolve(__dirname, "./src") } },
|
|
|
|
|
test: {
|
|
|
|
|
name: "unit",
|
|
|
|
|
environment: "node",
|
|
|
|
|
include: ["src/**/*.test.ts"],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-09-16 11:34:53 +00:00
|
|
|
resolve: {
|
2026-09-16 13:19:32 +00:00
|
|
|
alias: {
|
|
|
|
|
"@": path.resolve(__dirname, "./src"),
|
|
|
|
|
// Replace server-only with the empty stub so integration tests
|
|
|
|
|
// can import server modules without "imported from a Client
|
|
|
|
|
// Component module" blowing up at prepare time.
|
|
|
|
|
"server-only": fileURLToPath(
|
|
|
|
|
new URL("./src/lib/server-only-stub.ts", import.meta.url)
|
|
|
|
|
),
|
|
|
|
|
},
|
2026-09-16 11:36:42 +00:00
|
|
|
conditions: ["react-server", "node", "import", "default"],
|
2026-09-16 11:34:53 +00:00
|
|
|
},
|
2026-09-16 07:37:43 +00:00
|
|
|
test: {
|
|
|
|
|
name: "integration",
|
|
|
|
|
environment: "node",
|
|
|
|
|
include: ["tests/integration/**/*.test.ts"],
|
|
|
|
|
hookTimeout: 30_000,
|
|
|
|
|
testTimeout: 30_000,
|
2026-09-16 11:36:42 +00:00
|
|
|
poolOptions: { forks: { singleFork: true } },
|
2026-09-16 07:37:43 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
});
|