diff --git a/vitest.extensions.config.ts b/vitest.extensions.config.ts index ae83c8be260..187e8e4ef25 100644 --- a/vitest.extensions.config.ts +++ b/vitest.extensions.config.ts @@ -23,6 +23,7 @@ export function loadIncludePatternsFromEnv( export default createScopedVitestConfig( loadIncludePatternsFromEnv() ?? ["extensions/**/*.test.ts"], { + pool: "threads", // Channel implementations live under extensions/ but are tested by // vitest.channels.config.ts (pnpm test:channels) which provides // the heavier mock scaffolding they need. diff --git a/vitest.scoped-config.ts b/vitest.scoped-config.ts index 8384b07f64f..30eb2c87e4b 100644 --- a/vitest.scoped-config.ts +++ b/vitest.scoped-config.ts @@ -1,9 +1,14 @@ import { defineConfig } from "vitest/config"; import baseConfig from "./vitest.config.ts"; -export function createScopedVitestConfig(include: string[], options?: { exclude?: string[] }) { +export function createScopedVitestConfig( + include: string[], + options?: { exclude?: string[]; pool?: "threads" | "forks" | "vmForks" }, +) { const base = baseConfig as unknown as Record; - const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {}; + const baseTest = + (baseConfig as { test?: { exclude?: string[]; pool?: "threads" | "forks" | "vmForks" } }) + .test ?? {}; const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])]; return defineConfig({ @@ -12,6 +17,7 @@ export function createScopedVitestConfig(include: string[], options?: { exclude? ...baseTest, include, exclude, + ...(options?.pool ? { pool: options.pool } : {}), }, }); }