test: dedupe provider fetch mock reads · openclaw/openclaw@a06b735
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,15 +50,17 @@ vi.mock("./provider-request-config.js", () => ({
|
50 | 50 | })); |
51 | 51 | |
52 | 52 | function latestGuardedFetchParams(): Record<string, unknown> { |
53 | | -const params = fetchWithSsrFGuardMock.mock.calls.at(-1)?.[0]; |
| 53 | +const calls = fetchWithSsrFGuardMock.mock.calls; |
| 54 | +const params = calls[calls.length - 1]?.[0]; |
54 | 55 | if (!params || typeof params !== "object") { |
55 | 56 | throw new Error("Expected guarded fetch call"); |
56 | 57 | } |
57 | 58 | return params; |
58 | 59 | } |
59 | 60 | |
60 | 61 | function latestTrustedEnvProxyParams(): Record<string, unknown> { |
61 | | -const params = withTrustedEnvProxyGuardedFetchModeMock.mock.calls.at(-1)?.[0]; |
| 62 | +const calls = withTrustedEnvProxyGuardedFetchModeMock.mock.calls; |
| 63 | +const params = calls[calls.length - 1]?.[0]; |
62 | 64 | if (!params || typeof params !== "object") { |
63 | 65 | throw new Error("Expected trusted env proxy call"); |
64 | 66 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。