mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: tighten web fetch token log assertion
This commit is contained in:
@@ -155,13 +155,10 @@ describe("web_fetch Cloudflare Markdown for Agents", () => {
|
||||
|
||||
await tool?.execute?.("call", { url: "https://example.com/tokens/private?token=secret" });
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("x-markdown-tokens: 1500 (https://example.com/...)"),
|
||||
);
|
||||
const tokenLogs = logSpy.mock.calls
|
||||
.map(([message]) => message)
|
||||
.filter((message) => message.includes("x-markdown-tokens"));
|
||||
expect(tokenLogs).toHaveLength(1);
|
||||
expect(tokenLogs).toEqual(["[web-fetch] x-markdown-tokens: 1500 (https://example.com/...)"]);
|
||||
expect(tokenLogs[0]).not.toContain("token=secret");
|
||||
expect(tokenLogs[0]).not.toContain("/tokens/private");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user