The roadmap-dashboard Vitest sub-project overrode setupFiles with only its jsdom helper. Vitest replaces (does not merge) setupFiles in child projects, so the central isolation guard at packages/core/src/__test-utils__/vitest-setup.ts was silently bypassed for the 94 roadmap-dashboard tests, leaving them able to touch the real project .fusion / $HOME / child processes without the leak-detection and AI-CLI block. Prepend the central guard so it loads before the dashboard jsdom setup. All 94 roadmap-dashboard tests still pass.
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { fileURLToPath } from "node:url";
|
|
import { computeMaxWorkers } from "../../packages/core/src/__test-utils__/vitest-workers";
|
|
|
|
const maxWorkers = computeMaxWorkers();
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
"@fusion/core": fileURLToPath(new URL("../../packages/core/src/index.ts", import.meta.url)),
|
|
"@fusion/plugin-sdk": fileURLToPath(new URL("../../packages/plugin-sdk/src/index.ts", import.meta.url)),
|
|
},
|
|
},
|
|
test: {
|
|
setupFiles: [fileURLToPath(new URL("../../packages/core/src/__test-utils__/vitest-setup.ts", import.meta.url))],
|
|
globalSetup: [fileURLToPath(new URL("../../packages/core/src/__test-utils__/vitest-teardown.ts", import.meta.url))],
|
|
pool: "threads",
|
|
maxWorkers,
|
|
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers }, forks: { minForks: 1, maxForks: maxWorkers } },
|
|
projects: [
|
|
{
|
|
extends: true,
|
|
test: {
|
|
name: "roadmap-dashboard",
|
|
environment: "jsdom",
|
|
include: ["src/dashboard/**/__tests__/**/*.test.{ts,tsx}", "src/dashboard/**/*.test.{ts,tsx}"],
|
|
setupFiles: [
|
|
fileURLToPath(new URL("../../packages/core/src/__test-utils__/vitest-setup.ts", import.meta.url)),
|
|
fileURLToPath(new URL("./src/dashboard/test-setup.ts", import.meta.url)),
|
|
],
|
|
},
|
|
},
|
|
{
|
|
extends: true,
|
|
test: {
|
|
name: "roadmap-node",
|
|
environment: "node",
|
|
include: ["src/**/__tests__/**/*.test.{ts,tsx}", "src/**/*.test.{ts,tsx}"],
|
|
exclude: ["src/dashboard/**/__tests__/**/*.test.{ts,tsx}", "src/dashboard/**/*.test.{ts,tsx}"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|