mirror of https://github.com/openclaw/openclaw.git
test: tighten backoff abort coverage
This commit is contained in:
parent
e794417623
commit
70d6217dbe
|
|
@ -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(),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue