mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 06:14:23 +00:00
test: tighten backoff abort coverage
This commit is contained in:
@@ -33,4 +33,14 @@ describe("backoff helpers", () => {
|
||||
await expect(sleepWithAbort(0, AbortSignal.abort())).resolves.toBeUndefined();
|
||||
await expect(sleepWithAbort(-5)).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it("wraps aborted sleeps with a stable aborted error", async () => {
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
|
||||
await expect(sleepWithAbort(5, controller.signal)).rejects.toMatchObject({
|
||||
message: "aborted",
|
||||
cause: expect.anything(),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user