mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 16:42:27 +00:00
fix(producer): type video extraction failures
This commit is contained in:
@@ -193,10 +193,21 @@ describe("downloadToTemp atomic publication and bounded retry", () => {
|
||||
.mockResolvedValueOnce(new Response("complete"));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
const dir = makeTempDir();
|
||||
const onTransientRetry = vi.fn();
|
||||
|
||||
const path = await downloadToTemp("https://cdn.example/retry-503.mp4", dir, 1_000);
|
||||
const path = await downloadToTemp(
|
||||
"https://cdn.example/retry-503.mp4",
|
||||
dir,
|
||||
1_000,
|
||||
undefined,
|
||||
onTransientRetry,
|
||||
);
|
||||
|
||||
expect(fetchMock).toHaveBeenCalledTimes(2);
|
||||
expect(onTransientRetry).toHaveBeenCalledOnce();
|
||||
expect(onTransientRetry).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ kind: "http_transient", retryable: true }),
|
||||
);
|
||||
expect(readFileSync(path, "utf8")).toBe("complete");
|
||||
expect(temporaryDownloadEntries(dir)).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user