fix(test): allow empty extension lane

This commit is contained in:
Vincent Koc
2026-03-22 21:47:38 -07:00
parent e001e8f2f8
commit 9378b31e08
2 changed files with 20 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ export default createScopedVitestConfig(
{ {
dir: "extensions", dir: "extensions",
pool: "threads", pool: "threads",
passWithNoTests: true,
// Channel implementations live under extensions/ but are tested by // Channel implementations live under extensions/ but are tested by
// vitest.channels.config.ts (pnpm test:channels) which provides // vitest.channels.config.ts (pnpm test:channels) which provides
// the heavier mock scaffolding they need. // the heavier mock scaffolding they need.

View File

@@ -13,12 +13,25 @@ export function resolveVitestIsolation(
export function createScopedVitestConfig( export function createScopedVitestConfig(
include: string[], include: string[],
options?: { dir?: string; exclude?: string[]; pool?: "threads" | "forks" }, options?: {
dir?: string;
exclude?: string[];
pool?: "threads" | "forks";
passWithNoTests?: boolean;
},
) { ) {
const base = baseConfig as unknown as Record<string, unknown>; const base = baseConfig as unknown as Record<string, unknown>;
const baseTest = const baseTest =
(baseConfig as { test?: { dir?: string; exclude?: string[]; pool?: "threads" | "forks" } }) (
.test ?? {}; baseConfig as {
test?: {
dir?: string;
exclude?: string[];
pool?: "threads" | "forks";
passWithNoTests?: boolean;
};
}
).test ?? {};
const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])]; const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])];
return defineConfig({ return defineConfig({
@@ -30,6 +43,9 @@ export function createScopedVitestConfig(
include, include,
exclude, exclude,
...(options?.pool ? { pool: options.pool } : {}), ...(options?.pool ? { pool: options.pool } : {}),
...(options?.passWithNoTests !== undefined
? { passWithNoTests: options.passWithNoTests }
: {}),
}, },
}); });
} }