mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-17 04:50:51 +00:00
35 lines
854 B
TypeScript
35 lines
854 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveWindowsCommandShim } from "./windows-command.js";
|
|
|
|
describe("resolveWindowsCommandShim", () => {
|
|
it("leaves commands unchanged outside Windows", () => {
|
|
expect(
|
|
resolveWindowsCommandShim({
|
|
command: "pnpm",
|
|
cmdCommands: ["pnpm"],
|
|
platform: "linux",
|
|
}),
|
|
).toBe("pnpm");
|
|
});
|
|
|
|
it("appends .cmd for configured Windows shims", () => {
|
|
expect(
|
|
resolveWindowsCommandShim({
|
|
command: "pnpm",
|
|
cmdCommands: ["pnpm", "yarn"],
|
|
platform: "win32",
|
|
}),
|
|
).toBe("pnpm.cmd");
|
|
});
|
|
|
|
it("keeps explicit extensions on Windows", () => {
|
|
expect(
|
|
resolveWindowsCommandShim({
|
|
command: "npm.cmd",
|
|
cmdCommands: ["npm", "npx"],
|
|
platform: "win32",
|
|
}),
|
|
).toBe("npm.cmd");
|
|
});
|
|
});
|