From 69c1487e0b923a43d48b18c288e4a1fc6c19c3ab Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 09:01:04 +0100 Subject: [PATCH] test: clarify feishu streaming status assertions --- extensions/feishu/src/reply-dispatcher.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extensions/feishu/src/reply-dispatcher.test.ts b/extensions/feishu/src/reply-dispatcher.test.ts index 8cc29f5ee0e..85d36c61721 100644 --- a/extensions/feishu/src/reply-dispatcher.test.ts +++ b/extensions/feishu/src/reply-dispatcher.test.ts @@ -1138,7 +1138,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => { const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) => typeof call[0] === "string" ? call[0] : "", ); - expect(updateTexts.some((text) => text.includes("🔎 Web Search"))).toBe(true); + expect(updateTexts).toEqual(expect.arrayContaining([expect.stringContaining("🔎 Web Search")])); expect(streamingInstances[0].close).toHaveBeenCalledWith("final answer", { note: "Agent: agent", }); @@ -1171,9 +1171,11 @@ describe("createFeishuReplyDispatcher streaming behavior", () => { const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) => typeof call[0] === "string" ? call[0] : "", ); - expect( - updateTexts.some((text) => text.includes("🛠️ Exec: run tests, `pnpm test -- --watch=false`")), - ).toBe(true); + expect(updateTexts).toEqual( + expect.arrayContaining([ + expect.stringContaining("🛠️ Exec: run tests, `pnpm test -- --watch=false`"), + ]), + ); }); it("omits message-like tools from streaming card status", async () => { @@ -1199,7 +1201,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => { const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) => typeof call[0] === "string" ? call[0] : "", ); - expect(updateTexts.some((text) => text.includes("Message"))).toBe(false); + expect(updateTexts).not.toEqual(expect.arrayContaining([expect.stringContaining("Message")])); }); it("does not suppress a later final after error closeout", async () => {