test: guard cron stale enqueue call · openclaw/openclaw@933a597
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -326,10 +326,11 @@ describe("cron service ops regressions", () => {
|
326 | 326 | const result = await run(state, "stale-running", "force"); |
327 | 327 | expect(result).toEqual({ ok: true, ran: true }); |
328 | 328 | expect(enqueueSystemEvent).toHaveBeenCalledTimes(1); |
329 | | -expect(enqueueSystemEvent.mock.calls[0]?.[0]).toBe("stale-running"); |
330 | | -expect( |
331 | | -(enqueueSystemEvent.mock.calls[0]?.[1] as { agentId?: unknown } | undefined)?.agentId, |
332 | | -).toBeUndefined(); |
| 329 | +const enqueueCall = enqueueSystemEvent.mock.calls[0]; |
| 330 | +expect(enqueueCall).toBeDefined(); |
| 331 | +const [text, options] = enqueueCall as [string, { agentId?: unknown }?]; |
| 332 | +expect(text).toBe("stale-running"); |
| 333 | +expect(options?.agentId).toBeUndefined(); |
333 | 334 | }); |
334 | 335 | |
335 | 336 | it("queues manual cron.run requests behind the cron execution lane", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。