test: guard ui tooling assertions · openclaw/openclaw@3c9fbf7
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -818,10 +818,13 @@ describe("scripts/lib/docker-e2e-plan", () => {
|
818 | 818 | ), |
819 | 819 | ); |
820 | 820 | expect(plan.lanes).toHaveLength(BUNDLED_PLUGIN_INSTALL_UNINSTALL_SHARDS); |
821 | | -expect(plan.lanes.at(0)).toBeDefined(); |
822 | | -expect(plan.lanes.at(23)).toBeDefined(); |
823 | | -expect(summarizeLane(plan.lanes[0])).toEqual(bundledPluginSweepLane(0)); |
824 | | -expect(summarizeLane(plan.lanes[23])).toEqual(bundledPluginSweepLane(23)); |
| 821 | +const firstLane = plan.lanes[0]; |
| 822 | +const lastLane = plan.lanes[23]; |
| 823 | +if (!firstLane || !lastLane) { |
| 824 | +throw new Error("Expected bundled plugin sweep boundary lanes"); |
| 825 | +} |
| 826 | +expect(summarizeLane(firstLane)).toEqual(bundledPluginSweepLane(0)); |
| 827 | +expect(summarizeLane(lastLane)).toEqual(bundledPluginSweepLane(23)); |
825 | 828 | expect(plan.needs).toEqual({ |
826 | 829 | bareImage: false, |
827 | 830 | e2eImage: true, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -177,12 +177,14 @@ function expectBufferedPerformanceEvent(
|
177 | 177 | return candidate.payload?.[key] === expected; |
178 | 178 | }); |
179 | 179 | }); |
180 | | -expect(entry).toBeDefined(); |
| 180 | +if (!entry) { |
| 181 | +throw new Error(`Expected performance event ${event}`); |
| 182 | +} |
181 | 183 | for (const [key, expected] of Object.entries(expectedPayload)) { |
182 | | -expect(entry?.payload?.[key]).toBe(expected); |
| 184 | +expect(entry.payload?.[key]).toBe(expected); |
183 | 185 | } |
184 | | -expect(entry?.payload?.durationMs).toBeTypeOf("number"); |
185 | | -return entry?.payload; |
| 186 | +expect(entry.payload?.durationMs).toBeTypeOf("number"); |
| 187 | +return entry.payload; |
186 | 188 | } |
187 | 189 | |
188 | 190 | describe("refreshActiveTab", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。