mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
perf: add vitest test perf workflows
This commit is contained in:
@@ -13,11 +13,12 @@ export function resolveVitestIsolation(
|
||||
|
||||
export function createScopedVitestConfig(
|
||||
include: string[],
|
||||
options?: { exclude?: string[]; pool?: "threads" | "forks" },
|
||||
options?: { dir?: string; exclude?: string[]; pool?: "threads" | "forks" },
|
||||
) {
|
||||
const base = baseConfig as unknown as Record<string, unknown>;
|
||||
const baseTest =
|
||||
(baseConfig as { test?: { exclude?: string[]; pool?: "threads" | "forks" } }).test ?? {};
|
||||
(baseConfig as { test?: { dir?: string; exclude?: string[]; pool?: "threads" | "forks" } })
|
||||
.test ?? {};
|
||||
const exclude = [...(baseTest.exclude ?? []), ...(options?.exclude ?? [])];
|
||||
|
||||
return defineConfig({
|
||||
@@ -25,6 +26,7 @@ export function createScopedVitestConfig(
|
||||
test: {
|
||||
...baseTest,
|
||||
isolate: resolveVitestIsolation(),
|
||||
...(options?.dir ? { dir: options.dir } : {}),
|
||||
include,
|
||||
exclude,
|
||||
...(options?.pool ? { pool: options.pool } : {}),
|
||||
|
||||
Reference in New Issue
Block a user