test: tighten timer delay callback assertion · openclaw/openclaw@0807620
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,11 +24,12 @@ describe("resolveSafeTimeoutDelayMs", () => {
|
24 | 24 | describe("setSafeTimeout", () => { |
25 | 25 | it("arms setTimeout with the clamped delay", () => { |
26 | 26 | const timeoutSpy = vi.spyOn(globalThis, "setTimeout"); |
| 27 | +const callback = () => undefined; |
27 | 28 | |
28 | | -const timer = setSafeTimeout(() => undefined, 3_000_000_000); |
| 29 | +const timer = setSafeTimeout(callback, 3_000_000_000); |
29 | 30 | clearTimeout(timer); |
30 | 31 | |
31 | | -expect(timeoutSpy).toHaveBeenCalledWith(expect.any(Function), MAX_SAFE_TIMEOUT_DELAY_MS); |
| 32 | +expect(timeoutSpy).toHaveBeenCalledWith(callback, MAX_SAFE_TIMEOUT_DELAY_MS); |
32 | 33 | timeoutSpy.mockRestore(); |
33 | 34 | }); |
34 | 35 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。