From 9db43df1e28ae21486715188a221d0eeee0364a7 Mon Sep 17 00:00:00 2001 From: ThanhNguyxn Date: Tue, 27 Jan 2026 12:15:16 +0700 Subject: [PATCH] test(infra): update binaries test for Windows/Unix platform detection --- src/infra/binaries.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/infra/binaries.test.ts b/src/infra/binaries.test.ts index 50b48d372..6c2faf96d 100644 --- a/src/infra/binaries.test.ts +++ b/src/infra/binaries.test.ts @@ -4,6 +4,8 @@ import type { runExec } from "../process/exec.js"; import type { RuntimeEnv } from "../runtime.js"; import { ensureBinary } from "./binaries.js"; +const expectedCmd = process.platform === "win32" ? "where" : "which"; + describe("ensureBinary", () => { it("passes through when binary exists", async () => { const exec: typeof runExec = vi.fn().mockResolvedValue({ @@ -16,7 +18,7 @@ describe("ensureBinary", () => { exit: vi.fn(), }; await ensureBinary("node", exec, runtime); - expect(exec).toHaveBeenCalledWith("which", ["node"]); + expect(exec).toHaveBeenCalledWith(expectedCmd, ["node"]); }); it("logs and exits when missing", async () => {