test: dedupe before-tool-call mock reads · openclaw/openclaw@9eed27a
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,7 @@ function requireApprovalRequestCall(label: string): {
|
36 | 36 | request: Record<string, unknown>; |
37 | 37 | options: Record<string, unknown>; |
38 | 38 | } { |
39 | | -const call = mockCallGatewayTool.mock.calls.at(0); |
| 39 | +const call = mockCallGatewayTool.mock.calls[0]; |
40 | 40 | if (!call) { |
41 | 41 | throw new Error(`expected ${label}`); |
42 | 42 | } |
@@ -52,7 +52,7 @@ function requireBeforeToolCall(
|
52 | 52 | mock: ReturnType<typeof vi.fn<HookRunner["runBeforeToolCall"]>>, |
53 | 53 | label: string, |
54 | 54 | ): Parameters<HookRunner["runBeforeToolCall"]> { |
55 | | -const call = mock.mock.calls.at(0); |
| 55 | +const call = mock.mock.calls[0]; |
56 | 56 | if (!call) { |
57 | 57 | throw new Error(`expected ${label}`); |
58 | 58 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。