test: avoid agent filter allocation assertions · openclaw/openclaw@66d2825
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1325,7 +1325,7 @@ describe("sessions tools", () => {
|
1325 | 1325 | ), |
1326 | 1326 | ); |
1327 | 1327 | expect(replyPromptAgentCalls).toEqual([]); |
1328 | | -expect(calls.filter((call) => call.method === "send")).toEqual([]); |
| 1328 | +expect(calls.some((call) => call.method === "send")).toBe(false); |
1329 | 1329 | }); |
1330 | 1330 | |
1331 | 1331 | it("sessions_send preserves threadId when announce target is hydrated via sessions.list", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -101,7 +101,7 @@ describe("subscribeEmbeddedPiSession", () => {
|
101 | 101 | expect(streamedText).toBe("Title\nLine one\nLine two"); |
102 | 102 | expect(streamedText).not.toContain("<"); |
103 | 103 | expect(streamedText).not.toContain("final>"); |
104 | | -expect(payloads.filter((payload) => payload.replace)).toEqual([]); |
| 104 | +expect(payloads.some((payload) => payload.replace)).toBe(false); |
105 | 105 | }); |
106 | 106 | |
107 | 107 | it("preserves final content when enforced final tags are split across streamed deltas", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -405,7 +405,7 @@ describe("context-pruning", () => {
|
405 | 405 | }); |
406 | 406 | |
407 | 407 | const tool = findToolResult(next, "t1"); |
408 | | -expect(tool.content.filter((block) => block.type === "image")).toEqual([]); |
| 408 | +expect(tool.content.some((block) => block.type === "image")).toBe(false); |
409 | 409 | expect(toolText(tool)).toContain("[image removed during context pruning]"); |
410 | 410 | expect(toolText(tool)).toContain("visible tool text"); |
411 | 411 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -855,7 +855,7 @@ describe("createOpenClawCodingTools", () => {
|
855 | 855 | const imageText = imageTextBlocks?.map((block) => block.text ?? "").join("\n") ?? ""; |
856 | 856 | expect(imageText).toContain("Read image file [image/png]"); |
857 | 857 | if ((imageBlocks?.length ?? 0) > 0) { |
858 | | -expect(imageBlocks?.filter((block) => block.mimeType !== "image/png")).toEqual([]); |
| 858 | +expect(imageBlocks?.every((block) => block.mimeType === "image/png")).toBe(true); |
859 | 859 | } else { |
860 | 860 | expect(imageText).toContain("[Image omitted:"); |
861 | 861 | } |
@@ -868,7 +868,7 @@ describe("createOpenClawCodingTools", () => {
|
868 | 868 | path: textPath, |
869 | 869 | }); |
870 | 870 | |
871 | | -expect(textResult?.content?.filter((block) => block.type === "image")).toEqual([]); |
| 871 | +expect(textResult?.content?.some((block) => block.type === "image")).toBe(false); |
872 | 872 | const textBlocks = textResult?.content?.filter((block) => block.type === "text") as |
873 | 873 | | Array<{ text?: string }> |
874 | 874 | | undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -209,7 +209,7 @@ describe("sanitizeToolUseResultPairing", () => {
|
209 | 209 | ]); |
210 | 210 | |
211 | 211 | const out = sanitizeToolUseResultPairing(input); |
212 | | -expect(out.filter((m) => m.role === "toolResult")).toEqual([]); |
| 212 | +expect(out.some((m) => m.role === "toolResult")).toBe(false); |
213 | 213 | expect(out.map((m) => m.role)).toEqual(["user", "assistant"]); |
214 | 214 | }); |
215 | 215 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。