mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-14 21:29:34 +00:00
21 lines
700 B
TypeScript
21 lines
700 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { classifyFfmpegSpawnError } from "./videoFrameExtractor.js";
|
|
|
|
describe("classifyFfmpegSpawnError", () => {
|
|
it.each(["ENOENT", "EACCES", "ENOEXEC", "UNKNOWN"])(
|
|
"keeps deterministic launch failure %s terminal",
|
|
(code) => {
|
|
expect(classifyFfmpegSpawnError(Object.assign(new Error(code), { code }))).toMatchObject({
|
|
retryable: false,
|
|
});
|
|
},
|
|
);
|
|
|
|
it.each(["EAGAIN", "EMFILE", "ENFILE"])("retries known transient launch failure %s", (code) => {
|
|
expect(classifyFfmpegSpawnError(Object.assign(new Error(code), { code }))).toMatchObject({
|
|
kind: "ffmpeg_transient",
|
|
retryable: true,
|
|
});
|
|
});
|
|
});
|