From b16bcda63ae5a23db5a8cf96be5c77972de10e62 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 10:17:12 +0100 Subject: [PATCH] test: clarify gateway command list assertions --- src/gateway/server-methods/commands.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gateway/server-methods/commands.test.ts b/src/gateway/server-methods/commands.test.ts index 92074f5b3d5..56cc0482984 100644 --- a/src/gateway/server-methods/commands.test.ts +++ b/src/gateway/server-methods/commands.test.ts @@ -278,7 +278,8 @@ describe("commands.list handler", () => { for (const scope of ["native", "text", "both"] as const) { const { payload } = callHandler({ scope }); const { commands } = payload as { commands: Array<{ name: string; source: string }> }; - expect(commands.some((c) => c.source === "plugin")).toBe(true); + const sources = commands.map((command) => command.source); + expect(sources).toContain("plugin"); } }); @@ -470,6 +471,9 @@ describe("buildCommandsListResult", () => { it("is callable independently from handler", () => { const result = buildCommandsListResult({ cfg: {} as never, agentId: "main" }); expect(result.commands.length).toBeGreaterThan(0); - expect(result.commands.every((c) => typeof c.scope === "string")).toBe(true); + const invalidScopes = result.commands + .map((command) => command.scope) + .filter((scope) => typeof scope !== "string"); + expect(invalidScopes).toEqual([]); }); });