test: dedupe cron service mock reads · openclaw/openclaw@2c3582a
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -253,7 +253,7 @@ describe("Cron issue regressions", () => {
|
253 | 253 | |
254 | 254 | const result = await cron.run("missing-enabled-due", "due"); |
255 | 255 | expect(result).toEqual({ ok: true, ran: true }); |
256 | | -const enqueueCall = enqueueSystemEvent.mock.calls.at(0); |
| 256 | +const enqueueCall = enqueueSystemEvent.mock.calls[0]; |
257 | 257 | if (!enqueueCall) { |
258 | 258 | throw new Error("Expected due cron job to enqueue a system event"); |
259 | 259 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -79,7 +79,7 @@ describe("CronService restart catch-up", () => {
|
79 | 79 | expectedText: string, |
80 | 80 | ) { |
81 | 81 | expect(enqueueSystemEvent).toHaveBeenCalledTimes(1); |
82 | | -const [text, options] = enqueueSystemEvent.mock.calls.at(0) ?? []; |
| 82 | +const [text, options] = enqueueSystemEvent.mock.calls[0] ?? []; |
83 | 83 | expect(text).toBe(expectedText); |
84 | 84 | expect((options as { agentId?: string } | undefined)?.agentId).toBeUndefined(); |
85 | 85 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。