test: tighten firecrawl tool assertions

This commit is contained in:
Peter Steinberger
2026-05-09 21:39:26 +01:00
parent c7ab83e8ab
commit eefb0ee6f8

View File

@@ -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", () => {