test: guard agent tool mock calls · openclaw/openclaw@0b69446
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,7 @@ describe("web-guarded-fetch", () => {
|
39 | 39 | |
40 | 40 | await withTrustedWebToolsEndpoint({ url: "https://example.com" }, async () => undefined); |
41 | 41 | |
42 | | -const call = vi.mocked(fetchWithSsrFGuard).mock.calls[0]?.[0]; |
| 42 | +const call = vi.mocked(fetchWithSsrFGuard).mock.calls.at(0)?.[0]; |
43 | 43 | expect(call?.url).toBe("https://example.com"); |
44 | 44 | expect(call?.policy).toEqual({ |
45 | 45 | allowRfc2544BenchmarkRange: true, |
@@ -58,7 +58,7 @@ describe("web-guarded-fetch", () => {
|
58 | 58 | |
59 | 59 | await withSelfHostedWebToolsEndpoint({ url: "http://127.0.0.1:8080" }, async () => undefined); |
60 | 60 | |
61 | | -const call = vi.mocked(fetchWithSsrFGuard).mock.calls[0]?.[0]; |
| 61 | +const call = vi.mocked(fetchWithSsrFGuard).mock.calls.at(0)?.[0]; |
62 | 62 | expect(call?.url).toBe("http://127.0.0.1:8080"); |
63 | 63 | expect(call?.policy?.dangerouslyAllowPrivateNetwork).toBe(true); |
64 | 64 | expect(call?.policy?.allowRfc2544BenchmarkRange).toBe(true); |
@@ -75,7 +75,7 @@ describe("web-guarded-fetch", () => {
|
75 | 75 | |
76 | 76 | await withStrictWebToolsEndpoint({ url: "https://example.com" }, async () => undefined); |
77 | 77 | |
78 | | -const call = vi.mocked(fetchWithSsrFGuard).mock.calls[0]?.[0]; |
| 78 | +const call = vi.mocked(fetchWithSsrFGuard).mock.calls.at(0)?.[0]; |
79 | 79 | expect(call?.url).toBe("https://example.com"); |
80 | 80 | expect(call?.policy).toBeUndefined(); |
81 | 81 | expect(call?.mode).toBe(GUARDED_FETCH_MODE.STRICT); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。