test: tighten heartbeat wake assertions · openclaw/openclaw@0f00244
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -402,23 +402,24 @@ describe("heartbeat-wake", () => {
|
402 | 402 | await vi.advanceTimersByTimeAsync(100); |
403 | 403 | |
404 | 404 | expect(handler).toHaveBeenCalledTimes(2); |
405 | | -expect(handler.mock.calls.map((call) => call[0])).toEqual( |
406 | | -expect.arrayContaining([ |
407 | | -{ |
408 | | -source: "cron", |
409 | | -intent: "event", |
410 | | -reason: "cron:job-a", |
411 | | -agentId: "ops", |
412 | | -sessionKey: "agent:ops:guildchat:channel:alerts", |
413 | | -}, |
414 | | -{ |
415 | | -source: "cron", |
416 | | -intent: "event", |
417 | | -reason: "cron:job-b", |
418 | | -agentId: "main", |
419 | | -sessionKey: "agent:main:forum:group:-1001", |
420 | | -}, |
421 | | -]), |
422 | | -); |
| 405 | +const handledRequests = handler.mock.calls |
| 406 | +.map((call) => call[0]) |
| 407 | +.toSorted((left, right) => left.reason.localeCompare(right.reason)); |
| 408 | +expect(handledRequests).toEqual([ |
| 409 | +{ |
| 410 | +source: "cron", |
| 411 | +intent: "event", |
| 412 | +reason: "cron:job-a", |
| 413 | +agentId: "ops", |
| 414 | +sessionKey: "agent:ops:guildchat:channel:alerts", |
| 415 | +}, |
| 416 | +{ |
| 417 | +source: "cron", |
| 418 | +intent: "event", |
| 419 | +reason: "cron:job-b", |
| 420 | +agentId: "main", |
| 421 | +sessionKey: "agent:main:forum:group:-1001", |
| 422 | +}, |
| 423 | +]); |
423 | 424 | }); |
424 | 425 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。