From 0fef42ddcc6f8c39a43ec2a48ba1850845bc384b Mon Sep 17 00:00:00 2001 From: Shakker Date: Sat, 9 May 2026 05:58:14 +0100 Subject: [PATCH] test: tighten plugin extension array assertions --- .../src/ddg-search-provider.test.ts | 2 +- extensions/google-meet/index.test.ts | 4 ++-- .../google-meet/src/config-compat.test.ts | 2 +- extensions/lmstudio/src/setup.test.ts | 6 ++--- .../src/bot.create-telegram-bot.test.ts | 4 ++-- .../contracts/boundary-invariants.test.ts | 22 +++++++++---------- .../contracts/config-boundary-guard.test.ts | 2 +- ...tension-package-project-boundaries.test.ts | 2 +- src/plugins/install.test.ts | 6 ++--- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/extensions/duckduckgo/src/ddg-search-provider.test.ts b/extensions/duckduckgo/src/ddg-search-provider.test.ts index 6c6836fb7ed..07324e68150 100644 --- a/extensions/duckduckgo/src/ddg-search-provider.test.ts +++ b/extensions/duckduckgo/src/ddg-search-provider.test.ts @@ -208,7 +208,7 @@ describe("duckduckgo web search provider", () => { `; expect(ddgClientTesting.isBotChallenge(challengeHtml)).toBe(true); - expect(ddgClientTesting.parseDuckDuckGoHtml(challengeHtml)).toEqual([]); + expect(ddgClientTesting.parseDuckDuckGoHtml(challengeHtml)).toStrictEqual([]); expect(ddgClientTesting.isBotChallenge(normalHtml)).toBe(false); expect(ddgClientTesting.parseDuckDuckGoHtml(normalHtml)).toEqual([ { diff --git a/extensions/google-meet/index.test.ts b/extensions/google-meet/index.test.ts index 163f8866223..b53a163a66f 100644 --- a/extensions/google-meet/index.test.ts +++ b/extensions/google-meet/index.test.ts @@ -1879,7 +1879,7 @@ describe("google-meet plugin", () => { ); expect( result.details.checks?.filter((check) => check.id === "chrome-local-audio-device"), - ).toEqual([]); + ).toStrictEqual([]); expect(runCommandWithTimeout).not.toHaveBeenCalled(); } finally { Object.defineProperty(process, "platform", { value: originalPlatform }); @@ -2960,7 +2960,7 @@ describe("google-meet plugin", () => { }); expect(respond.mock.calls[0]?.[0]).toBe(true); - expect(nodesList.mock.calls[0]).toEqual([]); + expect(nodesList.mock.calls[0]).toStrictEqual([]); expect(nodesInvoke).toHaveBeenCalledWith( expect.objectContaining({ nodeId: "node-1", diff --git a/extensions/google-meet/src/config-compat.test.ts b/extensions/google-meet/src/config-compat.test.ts index 05c3472a269..f8ac300f853 100644 --- a/extensions/google-meet/src/config-compat.test.ts +++ b/extensions/google-meet/src/config-compat.test.ts @@ -82,7 +82,7 @@ describe("google-meet config compatibility", () => { const migration = normalizeCompatibilityConfig({ cfg: config }); - expect(migration.changes).toEqual([]); + expect(migration.changes).toStrictEqual([]); expect( ( migration.config.plugins?.entries?.["google-meet"] as { diff --git a/extensions/lmstudio/src/setup.test.ts b/extensions/lmstudio/src/setup.test.ts index f9725384104..f43a96dd78a 100644 --- a/extensions/lmstudio/src/setup.test.ts +++ b/extensions/lmstudio/src/setup.test.ts @@ -735,7 +735,7 @@ describe("lmstudio setup", () => { provider: "lmstudio", agentDir: undefined, }); - expect(result.profiles).toEqual([]); + expect(result.profiles).toStrictEqual([]); expect(result.configPatch?.models?.providers?.lmstudio).toMatchObject({ baseUrl: "http://localhost:1234/v1", api: "openai-completions", @@ -819,7 +819,7 @@ describe("lmstudio setup", () => { provider: "lmstudio", agentDir: undefined, }); - expect(result.profiles).toEqual([]); + expect(result.profiles).toStrictEqual([]); expect(result.configPatch?.models?.providers?.lmstudio).toMatchObject({ baseUrl: "http://localhost:1234/v1", api: "openai-completions", @@ -856,7 +856,7 @@ describe("lmstudio setup", () => { provider: "lmstudio", agentDir: undefined, }); - expect(result.profiles).toEqual([]); + expect(result.profiles).toStrictEqual([]); expect(result.configPatch?.models?.providers?.lmstudio).toMatchObject({ apiKey: LMSTUDIO_LOCAL_API_KEY_PLACEHOLDER, }); diff --git a/extensions/telegram/src/bot.create-telegram-bot.test.ts b/extensions/telegram/src/bot.create-telegram-bot.test.ts index 6d02cceb761..6fd0ff2bffa 100644 --- a/extensions/telegram/src/bot.create-telegram-bot.test.ts +++ b/extensions/telegram/src/bot.create-telegram-bot.test.ts @@ -1353,7 +1353,7 @@ describe("createTelegramBot", () => { await runMiddlewareChain({ update: { update_id: 13_100 } }, async () => {}); await flushTelegramTestMicrotasks(); expect(onUpdateId).toHaveBeenCalledWith(13_100); - expect(unhandled).toEqual([]); + expect(unhandled).toStrictEqual([]); } finally { process.off("unhandledRejection", onUnhandledRejection); } @@ -3066,7 +3066,7 @@ describe("createTelegramBot", () => { const payload = requireValue(dispatchCall?.ctx, "topic dispatch context"); expect(payload.GroupSystemPrompt).toBe("Group prompt\n\nTopic prompt"); - expect(dispatchCall?.replyOptions?.skillFilter).toEqual([]); + expect(dispatchCall?.replyOptions?.skillFilter).toStrictEqual([]); }); it("threads native command replies inside topics", async () => { commandSpy.mockClear(); diff --git a/src/plugins/contracts/boundary-invariants.test.ts b/src/plugins/contracts/boundary-invariants.test.ts index 2cc2484ac1f..d815d94f466 100644 --- a/src/plugins/contracts/boundary-invariants.test.ts +++ b/src/plugins/contracts/boundary-invariants.test.ts @@ -228,7 +228,7 @@ describe("plugin contract boundary invariants", () => { } return readRepoSource(file).includes("contracts/inventory/bundled-capability-metadata"); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps the bundled contract inventory out of non-test runtime code", () => { @@ -236,7 +236,7 @@ describe("plugin contract boundary invariants", () => { const offenders = files.filter((file) => { return readRepoSource(file).includes("contracts/inventory/bundled-capability-metadata"); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps core tests off bundled extension deep imports", () => { @@ -246,7 +246,7 @@ describe("plugin contract boundary invariants", () => { (specifier) => !isAllowedBundledExtensionImport(specifier), ); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps plugin contract tests off bundled path helpers unless the test is explicitly about paths", () => { @@ -263,7 +263,7 @@ describe("plugin contract boundary invariants", () => { ) ); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps channel production code off bundled-plugin-metadata helpers", () => { @@ -271,7 +271,7 @@ describe("plugin contract boundary invariants", () => { const offenders = files.filter((file) => { return readRepoSource(file).includes("plugins/bundled-plugin-metadata"); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps contract loaders off hand-built bundled extension paths", () => { @@ -283,13 +283,13 @@ describe("plugin contract boundary invariants", () => { const source = readRepoSource(file); return /extensions\/\$\{|\.\.\/\.\.\/\.\.\/\.\.\/extensions\//u.test(source); }); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps bundled plugin production code off legacy before_agent_start hooks", () => { const files = listTsFiles("extensions", { excludeTests: true }); const offenders = files.filter((file) => readRepoSource(file).includes("before_agent_start")); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps bundled plugin typed hook registrations on an explicit allowlist", () => { @@ -312,7 +312,7 @@ describe("plugin contract boundary invariants", () => { it("keeps bundled plugin production code off raw registerHook calls", () => { const files = listTsFiles("extensions", { excludeTests: true }); const offenders = files.filter((file) => /\bregisterHook\(/u.test(readRepoSource(file))); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); it("keeps long-lived bundled hook handlers on live runtime config lookups", () => { @@ -324,7 +324,7 @@ describe("plugin contract boundary invariants", () => { .map((snippet) => `${file}: ${snippet}`); }, ); - expect(missingGuards).toEqual([]); + expect(missingGuards).toStrictEqual([]); }); it("keeps live provider config surfaces on runtime config lookups", () => { @@ -336,7 +336,7 @@ describe("plugin contract boundary invariants", () => { .map((snippet) => `${file}: ${snippet}`); }, ); - expect(missingGuards).toEqual([]); + expect(missingGuards).toStrictEqual([]); }); it("keeps long-lived bundled hook handlers off startup-only registration gates", () => { @@ -348,6 +348,6 @@ describe("plugin contract boundary invariants", () => { .map((snippet) => `${file}: ${snippet}`); }, ); - expect(offenders).toEqual([]); + expect(offenders).toStrictEqual([]); }); }); diff --git a/src/plugins/contracts/config-boundary-guard.test.ts b/src/plugins/contracts/config-boundary-guard.test.ts index cee1a23ba5e..dce54bf12b4 100644 --- a/src/plugins/contracts/config-boundary-guard.test.ts +++ b/src/plugins/contracts/config-boundary-guard.test.ts @@ -125,6 +125,6 @@ describe("config boundary guard", () => { ].join("\n"), ); - expect(collectDeprecatedInternalConfigApiViolations({ repoRoot })).toEqual([]); + expect(collectDeprecatedInternalConfigApiViolations({ repoRoot })).toStrictEqual([]); }); }); diff --git a/src/plugins/contracts/extension-package-project-boundaries.test.ts b/src/plugins/contracts/extension-package-project-boundaries.test.ts index 29fb48b886c..786fe97a043 100644 --- a/src/plugins/contracts/extension-package-project-boundaries.test.ts +++ b/src/plugins/contracts/extension-package-project-boundaries.test.ts @@ -262,6 +262,6 @@ describe("opt-in extension package boundaries", () => { }); it("keeps plugin-package-contract independent from core internals", () => { - expect(collectCoreReferenceFiles("packages/plugin-package-contract/src")).toEqual([]); + expect(collectCoreReferenceFiles("packages/plugin-package-contract/src")).toStrictEqual([]); }); }); diff --git a/src/plugins/install.test.ts b/src/plugins/install.test.ts index 00d3cadcb7b..c18f97a3739 100644 --- a/src/plugins/install.test.ts +++ b/src/plugins/install.test.ts @@ -771,7 +771,7 @@ describe("installPluginFromArchive", () => { }); expect(result.ok).toBe(true); - expect(warnings).toEqual([]); + expect(warnings).toStrictEqual([]); }); it("installs flat-root plugin archives from ClawHub-style downloads", async () => { @@ -1992,7 +1992,7 @@ describe("installPluginFromArchive", () => { }); expect(result.ok).toBe(true); - expect(warnings).toEqual([]); + expect(warnings).toStrictEqual([]); }); it("does not flag the real qa-matrix plugin as dangerous install code", async () => { @@ -2636,7 +2636,7 @@ describe("installPluginFromArchive", () => { expect(result.code).toBe(PLUGIN_INSTALL_ERROR_CODE.SECURITY_SCAN_FAILED); expect(result.error).toContain("code safety scan failed (Error: scanner exploded)"); } - expect(warnings).toEqual([]); + expect(warnings).toStrictEqual([]); scanSpy.mockRestore(); }); });