| 60 | }); |
| 61 | |
| 62 | function createSpawnSpy() { |
| 63 | const calls: Array<{ command: string; args: string[] }> = []; |
| 64 | const spawn = vi.fn((command: string, args: string[]) => { |
| 65 | calls.push({ command, args }); |
| 66 | const proc = new EventEmitter() as EventEmitter & { |
| 67 | stderr: EventEmitter; |
| 68 | kill: ReturnType<typeof vi.fn>; |
| 69 | killed: boolean; |
| 70 | }; |
| 71 | proc.stderr = new EventEmitter(); |
| 72 | proc.kill = vi.fn(); |
| 73 | proc.killed = false; |
| 74 | process.nextTick(() => proc.emit("close", 0)); |
| 75 | return proc; |
| 76 | }); |
| 77 | return { spawn, calls }; |
| 78 | } |
| 79 | |
| 80 | describe("runFfmpeg binary resolution", () => { |
| 81 | const originalFfmpegPath = process.env.HYPERFRAMES_FFMPEG_PATH; |