Files
openclaw/test/vitest/vitest.cli-process.config.ts
Peter Steinberger 896592b747 test(vitest): give config creators nameable return types
A vitest/vite type bump made inferred creator return types reach
vite-internal names (TS4058/TS4082), failing check-test-types repo-wide.
Annotate the scoped/extension config roots and the spread-rebuilding
creators with ViteUserConfig; also drop an unused workflow read, mutating
sorts, and an untyped record index left by 1f591bba56.
2026-08-10 09:35:51 -07:00

33 lines
995 B
TypeScript

import type { ViteUserConfig } from "vitest/config";
import { cliProcessTestFiles } from "./vitest.cli-process-paths.mjs";
// CLI process tests run serially in isolated forks so child startup deadlines
// measure the CLI rather than contention from the shared CLI test graph.
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
export function createCliProcessVitestConfig(
env?: Record<string, string | undefined>,
): ViteUserConfig {
const config = createScopedVitestConfig(cliProcessTestFiles, {
env,
fileParallelism: false,
isolate: true,
name: "cli-process",
passWithNoTests: true,
pool: "forks",
useNonIsolatedRunner: false,
});
return {
...config,
test: {
...config.test,
env: {
...config.test?.env,
// Avoid TSX's unbounded wait on esbuild's synchronous worker IPC in source-child tests.
ESBUILD_WORKER_THREADS: "0",
},
},
};
}
export default createCliProcessVitestConfig();