mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
perf: default extension vitest lanes to threads
This commit is contained in:
@@ -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<string, unknown>;
|
||||
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 } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user