Files
fusion/packages/desktop/vitest.config.ts
Fusion bb79f56f8f feat(FN-3106): add draft planning workflow with createAiSession plugin API
This merge delivers the full draft planning feature (FN-3106) — API routes for planning subtasks, the AiSessionStore backend for draft sessions, a draft planning API client, auto-creation of planning drafts from user input, and corresponding UI polish in PlanningModeModal with accessibility-focused

Fusion-Task-Id: FN-3106
2026-05-02 13:32:09 -07:00

42 lines
1.4 KiB
TypeScript

import { defineConfig } from "vitest/config";
import { cpus } from "node:os";
import { resolve } from "node:path";
// Cap fan-out to 4 to avoid saturating high-core machines under workspace concurrency.
const defaultMaxWorkers = Math.min(4, Math.max(1, cpus().length - 1));
const requestedMaxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? String(defaultMaxWorkers), 10);
const maxWorkers = Math.max(1, Number.isFinite(requestedMaxWorkers) ? requestedMaxWorkers : defaultMaxWorkers);
process.env.VITEST_MAX_WORKERS = String(maxWorkers);
export default defineConfig({
test: {
setupFiles: [resolve(__dirname, "../core/src/__test-utils__/vitest-setup.ts")],
globalSetup: [resolve(__dirname, "../core/src/__test-utils__/vitest-teardown.ts")],
testTimeout: 30_000,
hookTimeout: 30_000,
pool: "threads",
maxWorkers,
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers } },
fileParallelism: true,
passWithNoTests: true,
projects: [
{
test: {
name: "desktop",
include: ["src/__tests__/**/*.test.ts"],
pool: "threads",
isolate: true,
},
},
{
test: {
name: "desktop-renderer",
include: ["src/renderer/**/*.test.ts", "src/renderer/**/*.test.tsx"],
environment: "jsdom",
isolate: true,
},
},
],
},
});