forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.extensions.config.ts
More file actions
26 lines (23 loc) · 1.01 KB
/
vitest.extensions.config.ts
File metadata and controls
26 lines (23 loc) · 1.01 KB
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
import { BUNDLED_PLUGIN_TEST_GLOB } from "./scripts/lib/bundled-plugin-paths.mjs";
import { extensionExcludedChannelTestGlobs } from "./vitest.channel-paths.mjs";
import { loadPatternListFromEnv } from "./vitest.pattern-file.ts";
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
export function loadIncludePatternsFromEnv(
env: Record<string, string | undefined> = process.env,
): string[] | null {
return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
}
export function createExtensionsVitestConfig(
env: Record<string, string | undefined> = process.env,
) {
return createScopedVitestConfig(loadIncludePatternsFromEnv(env) ?? [BUNDLED_PLUGIN_TEST_GLOB], {
dir: "extensions",
env,
passWithNoTests: true,
setupFiles: ["test/setup.extensions.ts"],
// Some bundled plugins still run on the channel surface; keep those roots
// out of the shared extensions lane.
exclude: extensionExcludedChannelTestGlobs,
});
}
export default createExtensionsVitestConfig();