forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.boundary.config.ts
More file actions
35 lines (31 loc) 路 999 Bytes
/
Copy pathvitest.boundary.config.ts
File metadata and controls
35 lines (31 loc) 路 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from "vitest/config";
import baseConfig from "./vitest.config.ts";
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
import { boundaryTestFiles } from "./vitest.unit-paths.mjs";
const base = baseConfig as unknown as Record<string, unknown>;
const baseTest =
(
baseConfig as {
test?: {
exclude?: string[];
};
}
).test ?? {};
export function loadBoundaryIncludePatternsFromEnv(
env: Record<string, string | undefined> = process.env,
): string[] | null {
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
}
export function createBoundaryVitestConfig(env: Record<string, string | undefined> = process.env) {
return defineConfig({
...base,
test: {
...baseTest,
isolate: false,
runner: "./test/non-isolated-runner.ts",
include: loadBoundaryIncludePatternsFromEnv(env) ?? boundaryTestFiles,
setupFiles: [],
},
});
}
export default createBoundaryVitestConfig();