test(infra): update binaries test for Windows/Unix platform detection

This commit is contained in:
ThanhNguyxn committed 2026-01-29 19:22:23 +07:00
1 parent 23af14a32d
commit 9db43df1e2
1 file changed
+3 -1
+3 -1
View File
@@ -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 () => {