mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
fix(test): allow empty extension lane
This commit is contained in:
@@ -25,6 +25,7 @@ export default createScopedVitestConfig(
|
||||
{
|
||||
dir: "extensions",
|
||||
pool: "threads",
|
||||
passWithNoTests: true,
|
||||
// Channel implementations live under extensions/ but are tested by
|
||||
// vitest.channels.config.ts (pnpm test:channels) which provides
|
||||
// the heavier mock scaffolding they need.
|
||||
|
||||
@@ -13,12 +13,25 @@ export function resolveVitestIsolation(
|
||||
|
||||
export function createScopedVitestConfig(
|
||||
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 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 ?? [])];
|
||||
|
||||
return defineConfig({
|
||||
@@ -30,6 +43,9 @@ export function createScopedVitestConfig(
|
||||
include,
|
||||
exclude,
|
||||
...(options?.pool ? { pool: options.pool } : {}),
|
||||
...(options?.passWithNoTests !== undefined
|
||||
? { passWithNoTests: options.passWithNoTests }
|
||||
: {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user