38 lines
No EOL
1.1 KiB
TypeScript
38 lines
No EOL
1.1 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import path from "node:path";
|
|
|
|
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"],
|
|
},
|
|
},
|
|
{
|
|
resolve: {
|
|
alias: { "@": path.resolve(__dirname, "./src") },
|
|
// server-only throws on import unless this condition is set. The unit
|
|
// project deliberately does NOT set it: pure modules must stay free
|
|
// of server imports, and a failure there is the signal that one crept
|
|
// in.
|
|
conditions: ["react-server", "node", "import", "default"],
|
|
},
|
|
test: {
|
|
name: "integration",
|
|
environment: "node",
|
|
include: ["tests/integration/**/*.test.ts"],
|
|
hookTimeout: 30_000,
|
|
testTimeout: 30_000,
|
|
poolOptions: { forks: { singleFork: true } },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
}); |