test: dedupe tools catalog mock reads · openclaw/openclaw@ed3df9c
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
File tree
src/gateway/server-methods
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,15 +54,15 @@ function createInvokeParams(params: Record<string, unknown>) {
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function firstMockArg(mock: { mock: { calls: unknown[][] } }, label: string): unknown { |
57 | | -const arg = mock.mock.calls.at(0)?.at(0); |
| 57 | +const arg = mock.mock.calls[0]?.[0]; |
58 | 58 | if (arg === undefined) { |
59 | 59 | throw new Error(`Expected ${label}`); |
60 | 60 | } |
61 | 61 | return arg; |
62 | 62 | } |
63 | 63 | |
64 | 64 | function respondCall(respond: ReturnType<typeof vi.fn>): RespondCall { |
65 | | -const call = respond.mock.calls.at(0) as RespondCall | undefined; |
| 65 | +const call = respond.mock.calls[0] as RespondCall | undefined; |
66 | 66 | if (!call) { |
67 | 67 | throw new Error("expected respond call"); |
68 | 68 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。