Skip to content

Commit ddbf8b0

Browse files
committed
test(web): expect rejections when audio-extract spawn fails
Made-with: Cursor
1 parent 320985d commit ddbf8b0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/web/__tests__/unit/audio-extract.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ describe("audio-extract", () => {
9090
mockProcess.emit("error", new Error("spawn failed"));
9191
}, 10);
9292

93-
const result = await resultPromise;
94-
expect(result).toBe(false);
93+
await expect(resultPromise).rejects.toThrow(
94+
"ffmpeg process error: spawn failed",
95+
);
9596
});
9697

9798
it("uses correct ffmpeg arguments", async () => {
@@ -104,7 +105,9 @@ describe("audio-extract", () => {
104105
mockProcess.emit("close", 1);
105106
}, 10);
106107

107-
await resultPromise;
108+
await expect(resultPromise).rejects.toThrow(
109+
"ffmpeg could not read video file: no streams detected",
110+
);
108111

109112
const args = spawnArgs[0]?.args ?? [];
110113
expect(args).toContain("-i");

0 commit comments

Comments
 (0)