Skip to content

Commit b7371c2

Browse files
committed
test(engine): the recorded ffprobe major matches the build's own banner
1 parent 901dad9 commit b7371c2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { AddressInfo } from "node:net";
55
import { tmpdir } from "node:os";
66
import { join } from "node:path";
77
import { afterAll, beforeAll, describe, expect, it } from "vitest";
8-
import { getFfmpegBinary } from "./ffmpegBinaries.js";
8+
import { getFfmpegBinary, getFfprobeBinary } from "./ffmpegBinaries.js";
99
import {
1010
buildProbeFactsText,
1111
declareContentAddressedUrl,
@@ -137,8 +137,10 @@ describe.skipIf(!HAS_FFMPEG)("probing a file held at a URL", { timeout: 60_000 }
137137
expect(await readStoredFinalFrame(url, metadata)).toBeUndefined();
138138
});
139139

140-
it("records the ffprobe major version beside the facts", () => {
141-
expect(JSON.parse(factsJson).ffprobeMajor).toBeGreaterThan(0);
140+
it("records the ffprobe major version beside the facts, when the build reports one", () => {
141+
const banner = spawnSync(getFfprobeBinary(), ["-version"], { encoding: "utf-8" }).stdout;
142+
const major = Number(/version n?(\d+)/.exec(banner)?.[1]) || undefined;
143+
expect(JSON.parse(factsJson).ffprobeMajor).toBe(major);
142144
});
143145

144146
it("probes the media itself when its stored JSON cannot be read", async () => {

0 commit comments

Comments
 (0)