Files
hyperframes/packages/cli/src/commands/init.transcodeToMp4.windowsHide.test.ts
T
Miguel Ángel cfef528d3a fix: phone videos with an undecodable first audio track check, preview and render (#6551)
* fix: phone videos with an undecodable first audio track check, preview and render

* fix(engine): a rate-lane clip bakes its ramp from the decodable audio track

* test: phone-clip tests end ffprobe options before the input
2026-10-27 13:09:02 +00:00

30 lines
957 B
TypeScript

import { EventEmitter } from "node:events";
import { describe, expect, it, vi } from "vitest";
const { spawnMock } = vi.hoisted(() => ({ spawnMock: vi.fn() }));
vi.mock("node:child_process", async (importOriginal) => ({
...(await importOriginal<typeof import("node:child_process")>()),
spawn: spawnMock,
}));
vi.mock("../browser/ffmpeg.js", () => ({
findFFmpeg: () => "/fake/bin/ffmpeg",
findFFprobe: () => "/fake/bin/ffprobe",
getFFmpegInstallHint: () => "install ffmpeg",
}));
import { transcodeToMp4 } from "./init.js";
describe("transcodeToMp4 child-process options", () => {
it("hides the ffmpeg console window on Windows", async () => {
const proc = new EventEmitter();
spawnMock.mockReturnValue(proc);
const result = transcodeToMp4("/fake/in.webm", "/fake/out.mp4");
proc.emit("close", 0);
await result;
expect(spawnMock.mock.calls[0]?.[2]).toEqual(expect.objectContaining({ windowsHide: true }));
});
});