test: tighten commitment heartbeat assertion · openclaw/openclaw@9859c23
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -110,13 +110,15 @@ describe("commitments heartbeat delivery policy e2e", () => {
|
110 | 110 | expect(result.status).toBe("ran"); |
111 | 111 | expect(sendTelegram).not.toHaveBeenCalled(); |
112 | 112 | const store = await loadCommitmentStore(); |
113 | | -expect(store.commitments[0]).toMatchObject({ |
114 | | -id: "cm_target_none", |
115 | | -status: "pending", |
116 | | -attempts: 0, |
117 | | -}); |
118 | | -expect(store.commitments[0]).not.toHaveProperty("sourceUserText"); |
119 | | -expect(store.commitments[0]).not.toHaveProperty("sourceAssistantText"); |
| 113 | +const [persistedCommitment] = store.commitments; |
| 114 | +if (!persistedCommitment) { |
| 115 | +throw new Error("missing persisted commitment"); |
| 116 | +} |
| 117 | +expect(persistedCommitment.id).toBe("cm_target_none"); |
| 118 | +expect(persistedCommitment.status).toBe("pending"); |
| 119 | +expect(persistedCommitment.attempts).toBe(0); |
| 120 | +expect(persistedCommitment).not.toHaveProperty("sourceUserText"); |
| 121 | +expect(persistedCommitment).not.toHaveProperty("sourceAssistantText"); |
120 | 122 | }); |
121 | 123 | }); |
122 | 124 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。