test: tighten web fetch token log assertion · openclaw/openclaw@5013002
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -155,13 +155,10 @@ describe("web_fetch Cloudflare Markdown for Agents", () => {
|
155 | 155 | |
156 | 156 | await tool?.execute?.("call", { url: "https://example.com/tokens/private?token=secret" }); |
157 | 157 | |
158 | | -expect(logSpy).toHaveBeenCalledWith( |
159 | | -expect.stringContaining("x-markdown-tokens: 1500 (https://example.com/...)"), |
160 | | -); |
161 | 158 | const tokenLogs = logSpy.mock.calls |
162 | 159 | .map(([message]) => message) |
163 | 160 | .filter((message) => message.includes("x-markdown-tokens")); |
164 | | -expect(tokenLogs).toHaveLength(1); |
| 161 | +expect(tokenLogs).toEqual(["[web-fetch] x-markdown-tokens: 1500 (https://example.com/...)"]); |
165 | 162 | expect(tokenLogs[0]).not.toContain("token=secret"); |
166 | 163 | expect(tokenLogs[0]).not.toContain("/tokens/private"); |
167 | 164 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。