test: tighten boundary empty array assertions

This commit is contained in:
Shakker
2026-05-09 04:34:09 +01:00
parent 50ba48c1fd
commit 81758c497c
7 changed files with 22 additions and 22 deletions

View File

@@ -60,7 +60,7 @@ describe("extension import boundary inventories", () => {
expect(jsonOutput.exitCode).toBe(0); expect(jsonOutput.exitCode).toBe(0);
expect(jsonOutput.stderr).toBe(""); expect(jsonOutput.stderr).toBe("");
expect(jsonOutput.json).toEqual([]); expect(jsonOutput.json).toStrictEqual([]);
}); });
}); });

View File

@@ -176,7 +176,7 @@ describe("non-extension test boundaries", () => {
}) })
.filter((value): value is { file: string; imports: string[] } => value !== null); .filter((value): value is { file: string; imports: string[] } => value !== null);
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps extension-owned onboard helper coverage out of the core onboard auth suite", () => { it("keeps extension-owned onboard helper coverage out of the core onboard auth suite", () => {
@@ -197,7 +197,7 @@ describe("non-extension test boundaries", () => {
bannedPluginSdkModules.has(entry), bannedPluginSdkModules.has(entry),
); );
expect(imports).toEqual([]); expect(imports).toStrictEqual([]);
}); });
it("keeps bundled plugin public-surface imports out of core source", () => { it("keeps bundled plugin public-surface imports out of core source", () => {
@@ -210,7 +210,7 @@ describe("non-extension test boundaries", () => {
return findBundledPluginPublicSurfaceImports(source).length > 0; return findBundledPluginPublicSurfaceImports(source).length > 0;
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps bundled plugin sync test-api loaders out of core tests", () => { it("keeps bundled plugin sync test-api loaders out of core tests", () => {
@@ -228,7 +228,7 @@ describe("non-extension test boundaries", () => {
return source.includes("loadBundledPluginTestApiSync("); return source.includes("loadBundledPluginTestApiSync(");
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps resolver tests on generated fixtures for broad bundled plugin source APIs", () => { it("keeps resolver tests on generated fixtures for broad bundled plugin source APIs", () => {
@@ -240,7 +240,7 @@ describe("non-extension test boundaries", () => {
); );
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps bundled channel security collector coverage under extension tests", () => { it("keeps bundled channel security collector coverage under extension tests", () => {
@@ -257,7 +257,7 @@ describe("non-extension test boundaries", () => {
); );
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps extension channel contract helpers on the public testing surface", () => { it("keeps extension channel contract helpers on the public testing surface", () => {
@@ -268,7 +268,7 @@ describe("non-extension test boundaries", () => {
return source.includes("src/channels/plugins/contracts/test-helpers/"); return source.includes("src/channels/plugins/contracts/test-helpers/");
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps extension tests off legacy broad testing barrels and repo helper bridges", () => { it("keeps extension tests off legacy broad testing barrels and repo helper bridges", () => {
@@ -287,7 +287,7 @@ describe("non-extension test boundaries", () => {
return bannedPatterns.some((pattern) => pattern.test(source)); return bannedPatterns.some((pattern) => pattern.test(source));
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps extension root test-support helpers from reaching into private src trees", () => { it("keeps extension root test-support helpers from reaching into private src trees", () => {
@@ -302,7 +302,7 @@ describe("non-extension test boundaries", () => {
}) })
.filter((entry): entry is { file: string; imports: string[] } => entry !== null); .filter((entry): entry is { file: string; imports: string[] } => entry !== null);
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
it("keeps bundled extension sources off deprecated channel config schema aliases", () => { it("keeps bundled extension sources off deprecated channel config schema aliases", () => {
@@ -313,6 +313,6 @@ describe("non-extension test boundaries", () => {
return source.includes("openclaw/plugin-sdk/channel-config-schema-legacy"); return source.includes("openclaw/plugin-sdk/channel-config-schema-legacy");
}); });
expect(offenders).toEqual([]); expect(offenders).toStrictEqual([]);
}); });
}); });

View File

@@ -40,7 +40,7 @@ describe("plugin extension import boundary inventory", () => {
file === "src/plugins/bundled-web-search-registry.ts", file === "src/plugins/bundled-web-search-registry.ts",
); );
expect(blockedShimFiles).toEqual([]); expect(blockedShimFiles).toStrictEqual([]);
}); });
it("ignores boundary shims by scope", async () => { it("ignores boundary shims by scope", async () => {
@@ -50,7 +50,7 @@ describe("plugin extension import boundary inventory", () => {
(file) => file.startsWith("src/plugin-sdk/") || file.startsWith("src/plugin-sdk-internal/"), (file) => file.startsWith("src/plugin-sdk/") || file.startsWith("src/plugin-sdk-internal/"),
); );
expect(boundaryShimFiles).toEqual([]); expect(boundaryShimFiles).toStrictEqual([]);
}); });
it("produces stable sorted output", async () => { it("produces stable sorted output", async () => {

View File

@@ -7,7 +7,7 @@ import { createCapturedIo } from "./helpers/captured-io.js";
describe("test-helper extension import boundary inventory", () => { describe("test-helper extension import boundary inventory", () => {
it("stays empty", async () => { it("stays empty", async () => {
expect(await collectTestHelperExtensionImportBoundaryInventory()).toEqual([]); expect(await collectTestHelperExtensionImportBoundaryInventory()).toStrictEqual([]);
}); });
it("script json output stays empty", async () => { it("script json output stays empty", async () => {
@@ -16,6 +16,6 @@ describe("test-helper extension import boundary inventory", () => {
expect(exitCode).toBe(0); expect(exitCode).toBe(0);
expect(captured.readStderr()).toBe(""); expect(captured.readStderr()).toBe("");
expect(JSON.parse(captured.readStdout())).toEqual([]); expect(JSON.parse(captured.readStdout())).toStrictEqual([]);
}); });
}); });

View File

@@ -45,7 +45,7 @@ describe("loadIncludePatternsFromEnv", () => {
describe("loadExtraExcludePatternsFromEnv", () => { describe("loadExtraExcludePatternsFromEnv", () => {
it("returns an empty list when no extra exclude file is configured", () => { it("returns an empty list when no extra exclude file is configured", () => {
expect(loadExtraExcludePatternsFromEnv({})).toEqual([]); expect(loadExtraExcludePatternsFromEnv({})).toStrictEqual([]);
}); });
it("loads extra exclude patterns from a JSON file", () => { it("loads extra exclude patterns from a JSON file", () => {

View File

@@ -55,7 +55,7 @@ describe("unit-fast vitest lane", () => {
expect(testConfig.isolate).toBe(false); expect(testConfig.isolate).toBe(false);
expect(testConfig.runner).toBeUndefined(); expect(testConfig.runner).toBeUndefined();
expect(testConfig.setupFiles).toEqual([]); expect(testConfig.setupFiles).toStrictEqual([]);
expect(testConfig.include).toContain("src/agents/pi-tools.deferred-followup-guidance.test.ts"); expect(testConfig.include).toContain("src/agents/pi-tools.deferred-followup-guidance.test.ts");
expect(testConfig.include).toContain("src/acp/control-plane/runtime-cache.test.ts"); expect(testConfig.include).toContain("src/acp/control-plane/runtime-cache.test.ts");
expect(testConfig.include).toContain("src/acp/runtime/registry.test.ts"); expect(testConfig.include).toContain("src/acp/runtime/registry.test.ts");
@@ -138,7 +138,7 @@ describe("unit-fast vitest lane", () => {
expect(isUnitFastTestFile(file)).toBe(true); expect(isUnitFastTestFile(file)).toBe(true);
} }
const unroutedForcedFiles = collectUnroutedForcedFiles(analysis, forcedFileSet); const unroutedForcedFiles = collectUnroutedForcedFiles(analysis, forcedFileSet);
expect(unroutedForcedFiles).toEqual([]); expect(unroutedForcedFiles).toStrictEqual([]);
}); });
it("keeps broad audit candidates separate from automatically routed unit-fast tests", () => { it("keeps broad audit candidates separate from automatically routed unit-fast tests", () => {

View File

@@ -31,17 +31,17 @@ describe("web provider boundaries", () => {
const violations = await webFetchViolationsPromise; const violations = await webFetchViolationsPromise;
const jsonOutput = await webFetchJsonOutputPromise; const jsonOutput = await webFetchJsonOutputPromise;
expect(violations).toEqual([]); expect(violations).toStrictEqual([]);
expect(jsonOutput.exitCode).toBe(0); expect(jsonOutput.exitCode).toBe(0);
expect(jsonOutput.stderr).toBe(""); expect(jsonOutput.stderr).toBe("");
expect(jsonOutput.json).toEqual([]); expect(jsonOutput.json).toStrictEqual([]);
}); });
it("keeps web search provider boundary inventory empty, core-only, and sorted", async () => { it("keeps web search provider boundary inventory empty, core-only, and sorted", async () => {
const inventory = await webSearchInventoryPromise; const inventory = await webSearchInventoryPromise;
const jsonOutput = await webSearchJsonOutputPromise; const jsonOutput = await webSearchJsonOutputPromise;
expect(inventory).toEqual([]); expect(inventory).toStrictEqual([]);
expect( expect(
[...inventory].toSorted( [...inventory].toSorted(
(left, right) => (left, right) =>
@@ -53,6 +53,6 @@ describe("web provider boundaries", () => {
).toEqual(inventory); ).toEqual(inventory);
expect(jsonOutput.exitCode).toBe(0); expect(jsonOutput.exitCode).toBe(0);
expect(jsonOutput.stderr).toBe(""); expect(jsonOutput.stderr).toBe("");
expect(jsonOutput.json).toEqual([]); expect(jsonOutput.json).toStrictEqual([]);
}); });
}); });