test: guard cron heartbeat target mock calls · openclaw/openclaw@b066819
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -49,7 +49,7 @@ describe("cron main job passes heartbeat target=last", () => {
|
49 | 49 | function requireRunHeartbeatOnceCall( |
50 | 50 | runHeartbeatOnce: ReturnType<typeof vi.fn<RunHeartbeatOnce>>, |
51 | 51 | ) { |
52 | | -const callArgs = runHeartbeatOnce.mock.calls[0]?.[0]; |
| 52 | +const callArgs = runHeartbeatOnce.mock.calls.at(0)?.[0]; |
53 | 53 | const heartbeat = callArgs?.heartbeat; |
54 | 54 | if (!callArgs || !heartbeat) { |
55 | 55 | throw new Error("expected runHeartbeatOnce call with heartbeat config"); |
@@ -58,7 +58,7 @@ describe("cron main job passes heartbeat target=last", () => {
|
58 | 58 | } |
59 | 59 | |
60 | 60 | function requireRequestHeartbeatCall(requestHeartbeat: ReturnType<typeof vi.fn>) { |
61 | | -const callArgs = requestHeartbeat.mock.calls[0]?.[0]; |
| 61 | +const callArgs = requestHeartbeat.mock.calls.at(0)?.[0]; |
62 | 62 | if (!callArgs) { |
63 | 63 | throw new Error("expected requestHeartbeat call"); |
64 | 64 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。