mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 22:04:45 +00:00
test: tighten infra helper assertions
This commit is contained in:
@@ -105,7 +105,7 @@ describe("wrapFetchWithAbortSignal", () => {
|
||||
duplex: "half",
|
||||
} as RequestInit & { duplex: "half" });
|
||||
|
||||
expect(getSeenInit()).toMatchObject({ duplex: "half" });
|
||||
expect((getSeenInit() as (RequestInit & { duplex?: string }) | undefined)?.duplex).toBe("half");
|
||||
});
|
||||
|
||||
it("converts foreign abort signals to native controllers", async () => {
|
||||
|
||||
@@ -152,14 +152,12 @@ describe("retryAsync", () => {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
expect(res).toBe("ok");
|
||||
expect(onRetry).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
attempt: 1,
|
||||
maxAttempts: 2,
|
||||
err,
|
||||
label: "telegram",
|
||||
}),
|
||||
);
|
||||
expect(onRetry).toHaveBeenCalledOnce();
|
||||
const retryEvent = onRetry.mock.calls[0]?.[0];
|
||||
expect(retryEvent?.attempt).toBe(1);
|
||||
expect(retryEvent?.maxAttempts).toBe(2);
|
||||
expect(retryEvent?.err).toBe(err);
|
||||
expect(retryEvent?.label).toBe("telegram");
|
||||
});
|
||||
|
||||
it("retries immediately when the resolved delay is zero", async () => {
|
||||
|
||||
Reference in New Issue
Block a user