mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 06:13:43 +00:00
Cron: guard missing expr in schedule parsing
This commit is contained in:
@@ -33,4 +33,13 @@ describe("cron stagger helpers", () => {
|
||||
expect(resolveCronStaggerMs({ kind: "cron", expr: "0 * * * *", staggerMs: 0 })).toBe(0);
|
||||
expect(resolveCronStaggerMs({ kind: "cron", expr: "15 * * * *" })).toBe(0);
|
||||
});
|
||||
|
||||
it("handles missing runtime expr values without throwing", () => {
|
||||
expect(() =>
|
||||
resolveCronStaggerMs({ kind: "cron" } as unknown as { kind: "cron"; expr: string }),
|
||||
).not.toThrow();
|
||||
expect(
|
||||
resolveCronStaggerMs({ kind: "cron" } as unknown as { kind: "cron"; expr: string }),
|
||||
).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user