Skip to content

Commit a3928ad

Browse files
committed
test(engine): accept resolved ffmpeg binary paths
1 parent a9ee029 commit a3928ad

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎packages/engine/src/services/streamingEncoder.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { EventEmitter } from "events";
1313
import { mkdtempSync } from "fs";
1414
import { tmpdir } from "os";
15-
import { join } from "path";
15+
import { basename, join } from "path";
1616
import { afterEach, describe, expect, it, vi } from "vitest";
1717

1818
import {
@@ -490,7 +490,7 @@ describe("spawnStreamingEncoder lifecycle and cleanup", () => {
490490
const encoder = await spawnStreamingEncoder(join(dir, "out.mp4"), baseOptions);
491491

492492
expect(calls).toHaveLength(1);
493-
expect(calls[0]?.command).toBe("ffmpeg");
493+
expect(basename(calls[0]?.command ?? "")).toMatch(/^ffmpeg(?:\.exe)?$/);
494494

495495
const proc = calls[0]!.proc;
496496
const closePromise = encoder.close();

‎packages/engine/src/utils/ffprobe.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// fallow-ignore-file code-duplication
22
import { EventEmitter } from "events";
33
import { readFileSync } from "fs";
4-
import { resolve } from "path";
4+
import { basename, resolve } from "path";
55
import { afterEach, describe, expect, it, vi } from "vitest";
66
import { extractMediaMetadata, extractPngMetadataFromBuffer } from "./ffprobe.js";
77

@@ -209,7 +209,7 @@ describe("ffprobe missing-binary fallback", () => {
209209
const meta = await extractMediaMetadataMocked(fixture);
210210

211211
expect(calls.length).toBe(1);
212-
expect(calls[0]?.command).toBe("ffprobe");
212+
expect(basename(calls[0]?.command ?? "")).toMatch(/^ffprobe(?:\.exe)?$/);
213213
expect(meta.videoCodec).toBe("png");
214214
expect(meta.durationSeconds).toBe(0);
215215
expect(meta.fps).toBe(0);
@@ -313,7 +313,7 @@ describe("ffprobe missing-binary fallback", () => {
313313
/ffprobe not found/,
314314
);
315315
expect(calls.length).toBe(1);
316-
expect(calls[0]?.command).toBe("ffprobe");
316+
expect(basename(calls[0]?.command ?? "")).toMatch(/^ffprobe(?:\.exe)?$/);
317317
});
318318

319319
it("analyzeKeyframeIntervals surfaces a ffprobe-missing error verbatim", async () => {
@@ -327,7 +327,7 @@ describe("ffprobe missing-binary fallback", () => {
327327
/ffprobe not found/,
328328
);
329329
expect(calls.length).toBe(1);
330-
expect(calls[0]?.command).toBe("ffprobe");
330+
expect(basename(calls[0]?.command ?? "")).toMatch(/^ffprobe(?:\.exe)?$/);
331331
});
332332

333333
it("ffprobe-missing error message includes install hint", async () => {

0 commit comments

Comments
 (0)