test: tighten compaction wait assertions · openclaw/openclaw@e204d1b
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -114,10 +114,14 @@ describe("subscribeEmbeddedPiSession", () => {
|
114 | 114 | const waitPromise = subscription.waitForCompactionRetry(); |
115 | 115 | subscription.unsubscribe(); |
116 | 116 | |
117 | | -await expect(waitPromise).rejects.toMatchObject({ name: "AbortError" }); |
118 | | -await expect(subscription.waitForCompactionRetry()).rejects.toMatchObject({ |
119 | | -name: "AbortError", |
120 | | -}); |
| 117 | +const firstAbort = await waitPromise.catch((error: unknown) => error); |
| 118 | +expect(firstAbort).toBeInstanceOf(Error); |
| 119 | +expect((firstAbort as Error).name).toBe("AbortError"); |
| 120 | +const secondAbort = await subscription |
| 121 | +.waitForCompactionRetry() |
| 122 | +.catch((error: unknown) => error); |
| 123 | +expect(secondAbort).toBeInstanceOf(Error); |
| 124 | +expect((secondAbort as Error).name).toBe("AbortError"); |
121 | 125 | expect(abortCompaction).toHaveBeenCalledTimes(1); |
122 | 126 | }); |
123 | 127 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。