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",
|
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.
|
||||||
|
|||||||
@@ -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 }
|
||||||
|
: {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user