From eefb0ee6f81c93b826aaea29001a783784b2256d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 21:39:26 +0100 Subject: [PATCH] test: tighten firecrawl tool assertions --- .../firecrawl/src/firecrawl-tools.test.ts | 52 ++++++++----------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/extensions/firecrawl/src/firecrawl-tools.test.ts b/extensions/firecrawl/src/firecrawl-tools.test.ts index 52a3f37956d..6cd331bb8a6 100644 --- a/extensions/firecrawl/src/firecrawl-tools.test.ts +++ b/extensions/firecrawl/src/firecrawl-tools.test.ts @@ -413,19 +413,16 @@ describe("firecrawl tools", () => { categories: ["research"], scrapeResults: true, }); - expect(result).toMatchObject({ - details: { - ok: true, - params: { - cfg: { env: "test" }, - query: "web search", - count: 6, - timeoutSeconds: 12, - sources: ["web", "news"], - categories: ["research"], - scrapeResults: true, - }, - }, + const details = result.details as { ok?: boolean; params?: unknown }; + expect(details.ok).toBe(true); + expect(details.params).toEqual({ + cfg: { env: "test" }, + query: "web search", + count: 6, + timeoutSeconds: 12, + sources: ["web", "news"], + categories: ["research"], + scrapeResults: true, }); }); @@ -455,21 +452,18 @@ describe("firecrawl tools", () => { storeInCache: false, timeoutSeconds: 22, }); - expect(result).toMatchObject({ - details: { - ok: true, - params: { - cfg: { env: "test" }, - url: "https://docs.openclaw.ai", - extractMode: "markdown", - maxChars: 1500, - onlyMainContent: false, - maxAgeMs: 5000, - proxy: "stealth", - storeInCache: false, - timeoutSeconds: 22, - }, - }, + const details = result.details as { ok?: boolean; params?: unknown }; + expect(details.ok).toBe(true); + expect(details.params).toEqual({ + cfg: { env: "test" }, + url: "https://docs.openclaw.ai", + extractMode: "markdown", + maxChars: 1500, + onlyMainContent: false, + maxAgeMs: 5000, + proxy: "stealth", + storeInCache: false, + timeoutSeconds: 22, }); }); @@ -732,7 +726,7 @@ describe("firecrawl tools", () => { ); expect(fetchSpy).toHaveBeenCalledTimes(1); - expect(result).toMatchObject({ success: true }); + expect(result.success).toBe(true); }); it("respects positive numeric overrides for scrape and cache behavior", () => {