mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 14:51:08 +00:00
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
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"],
|
|
// Most channel implementations stay on the channel surface, but a few
|
|
// transport-only suites live better in the general extensions lane.
|
|
exclude: extensionExcludedChannelTestGlobs,
|
|
});
|
|
}
|
|
|
|
export default createExtensionsVitestConfig();
|