mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
30 lines
1012 B
TypeScript
30 lines
1012 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { loadPatternListFromEnv, narrowIncludePatternsForCli } from "./vitest.pattern-file.ts";
|
|
import { sharedVitestConfig } from "./vitest.shared.config.ts";
|
|
import { unitFastTestFiles } from "./vitest.unit-fast-paths.mjs";
|
|
|
|
export function createUnitFastVitestConfig(
|
|
env: Record<string, string | undefined> = process.env,
|
|
options: { argv?: string[] } = {},
|
|
) {
|
|
const sharedTest = sharedVitestConfig.test ?? {};
|
|
const includeFromEnv = loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
|
|
const cliInclude = narrowIncludePatternsForCli(unitFastTestFiles, options.argv);
|
|
|
|
return defineConfig({
|
|
...sharedVitestConfig,
|
|
test: {
|
|
...sharedTest,
|
|
name: "unit-fast",
|
|
isolate: false,
|
|
runner: undefined,
|
|
setupFiles: [],
|
|
include: includeFromEnv ?? cliInclude ?? unitFastTestFiles,
|
|
exclude: sharedTest.exclude ?? [],
|
|
passWithNoTests: true,
|
|
},
|
|
});
|
|
}
|
|
|
|
export default createUnitFastVitestConfig();
|