test: tighten control ui buffer assertions · openclaw/openclaw@df22284
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,8 +70,13 @@ describe("recordControlUiPerformanceEvent", () => {
|
70 | 70 | } |
71 | 71 | |
72 | 72 | expect(host.eventLogBuffer).toHaveLength(250); |
73 | | -expect(host.eventLogBuffer[0]?.payload).toEqual({ i: 259 }); |
74 | | -expect(host.eventLogBuffer.at(-1)?.payload).toEqual({ i: 10 }); |
| 73 | +const [newestEvent] = host.eventLogBuffer; |
| 74 | +const oldestEvent = host.eventLogBuffer.at(-1); |
| 75 | +if (!newestEvent || !oldestEvent) { |
| 76 | +throw new Error("Expected bounded performance event buffer entries"); |
| 77 | +} |
| 78 | +expect(newestEvent.payload).toEqual({ i: 259 }); |
| 79 | +expect(oldestEvent.payload).toEqual({ i: 10 }); |
75 | 80 | }); |
76 | 81 | }); |
77 | 82 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。