Skip to content

Commit 402f0bd

Browse files
committed
test(cli): pin the platform in the Unix Chrome preflight tests so Windows runs them as written
1 parent 6ad0327 commit 402f0bd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/cli/src/browser/preflight.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,19 @@ describe("runEnvironmentChecks", () => {
3838
const originalFfmpegPath = process.env.HYPERFRAMES_FFMPEG_PATH;
3939
const originalFfprobePath = process.env.HYPERFRAMES_FFPROBE_PATH;
4040

41+
const realPlatform = process.platform;
42+
4143
beforeEach(() => {
44+
// The `--version` tests below describe the Unix path; the Windows block sets its own platform.
45+
Object.defineProperty(process, "platform", { value: "linux", configurable: true });
4246
process.env.HYPERFRAMES_FFMPEG_PATH = process.execPath;
4347
process.env.HYPERFRAMES_FFPROBE_PATH = process.execPath;
4448
runProcess.mockReset();
4549
runProcess.mockResolvedValue({ stdout: "ffmpeg version 7.1.1\n", stderr: "" });
4650
});
4751

4852
afterEach(() => {
53+
Object.defineProperty(process, "platform", { value: realPlatform, configurable: true });
4954
if (originalFfmpegPath === undefined) delete process.env.HYPERFRAMES_FFMPEG_PATH;
5055
else process.env.HYPERFRAMES_FFMPEG_PATH = originalFfmpegPath;
5156
if (originalFfprobePath === undefined) delete process.env.HYPERFRAMES_FFPROBE_PATH;

0 commit comments

Comments
 (0)