mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(vitest): prune duplicate include wrapper coverage
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
// Vitest boundary config tests validate boundary test configuration.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeConfigPath, normalizeConfigPaths } from "./helpers/vitest-config-paths.js";
|
||||
import {
|
||||
createBoundaryVitestConfig,
|
||||
loadBoundaryIncludePatternsFromEnv,
|
||||
} from "./vitest/vitest.boundary.config.ts";
|
||||
import { createBoundaryVitestConfig } from "./vitest/vitest.boundary.config.ts";
|
||||
import { boundaryTestFiles } from "./vitest/vitest.unit-paths.mjs";
|
||||
|
||||
function requireTestConfig(config: ReturnType<typeof createBoundaryVitestConfig>) {
|
||||
@@ -14,12 +11,6 @@ function requireTestConfig(config: ReturnType<typeof createBoundaryVitestConfig>
|
||||
return config.test;
|
||||
}
|
||||
|
||||
describe("loadBoundaryIncludePatternsFromEnv", () => {
|
||||
it("returns null when no include file is configured", () => {
|
||||
expect(loadBoundaryIncludePatternsFromEnv({})).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("boundary vitest config", () => {
|
||||
it("keeps boundary suites on the non-isolated runner with shared test bootstrap", () => {
|
||||
const config = createBoundaryVitestConfig({});
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// Vitest extensions config tests validate bundled extension test configuration.
|
||||
import { bundledPluginFile } from "openclaw/plugin-sdk/test-fixtures";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createPatternFileHelper } from "./helpers/pattern-file.js";
|
||||
import { loadIncludePatternsFromEnv } from "./vitest/vitest.extensions.config.ts";
|
||||
|
||||
const patternFiles = createPatternFileHelper("openclaw-vitest-extensions-config-");
|
||||
|
||||
afterEach(() => {
|
||||
patternFiles.cleanup();
|
||||
});
|
||||
|
||||
describe("extensions vitest include patterns", () => {
|
||||
it("returns null when no include file is configured", () => {
|
||||
expect(loadIncludePatternsFromEnv({})).toBeNull();
|
||||
});
|
||||
|
||||
it("loads include patterns from a JSON file", () => {
|
||||
const filePath = patternFiles.writePatternFile("include.json", [
|
||||
bundledPluginFile("feishu", "index.test.ts"),
|
||||
42,
|
||||
"",
|
||||
bundledPluginFile("msteams", "src/monitor.test.ts"),
|
||||
]);
|
||||
|
||||
expect(
|
||||
loadIncludePatternsFromEnv({
|
||||
OPENCLAW_VITEST_INCLUDE_FILE: filePath,
|
||||
}),
|
||||
).toEqual([
|
||||
bundledPluginFile("feishu", "index.test.ts"),
|
||||
bundledPluginFile("msteams", "src/monitor.test.ts"),
|
||||
]);
|
||||
});
|
||||
|
||||
it("throws when the configured file is not a JSON array", () => {
|
||||
const filePath = patternFiles.writePatternFile("include.json", {
|
||||
include: [bundledPluginFile("feishu", "index.test.ts")],
|
||||
});
|
||||
|
||||
expect(() =>
|
||||
loadIncludePatternsFromEnv({
|
||||
OPENCLAW_VITEST_INCLUDE_FILE: filePath,
|
||||
}),
|
||||
).toThrow(/JSON array/u);
|
||||
});
|
||||
});
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
createUnitVitestConfig,
|
||||
createUnitVitestConfigWithOptions,
|
||||
loadExtraExcludePatternsFromEnv,
|
||||
loadIncludePatternsFromEnv,
|
||||
resolveDefaultUnitCoverageIncludePatterns,
|
||||
} from "./vitest/vitest.unit.config.ts";
|
||||
|
||||
@@ -23,27 +22,6 @@ afterEach(() => {
|
||||
patternFiles.cleanup();
|
||||
});
|
||||
|
||||
describe("loadIncludePatternsFromEnv", () => {
|
||||
it("returns null when no include file is configured", () => {
|
||||
expect(loadIncludePatternsFromEnv({})).toBeNull();
|
||||
});
|
||||
|
||||
it("loads include patterns from a JSON file", () => {
|
||||
const filePath = patternFiles.writePatternFile("include.json", [
|
||||
"src/infra/update-runner.test.ts",
|
||||
42,
|
||||
"",
|
||||
"ui/src/ui/views/chat.test.ts",
|
||||
]);
|
||||
|
||||
expect(
|
||||
loadIncludePatternsFromEnv({
|
||||
OPENCLAW_VITEST_INCLUDE_FILE: filePath,
|
||||
}),
|
||||
).toEqual(["src/infra/update-runner.test.ts", "ui/src/ui/views/chat.test.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("loadExtraExcludePatternsFromEnv", () => {
|
||||
it("returns an empty list when no extra exclude file is configured", () => {
|
||||
expect(loadExtraExcludePatternsFromEnv({})).toStrictEqual([]);
|
||||
|
||||
Reference in New Issue
Block a user