mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
37 lines
893 B
TypeScript
37 lines
893 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { buildStringCommandShellInvocation } from "./string-command-shell.js";
|
|
|
|
describe("buildStringCommandShellInvocation", () => {
|
|
it("uses bash login-command semantics on unix platforms", () => {
|
|
expect(
|
|
buildStringCommandShellInvocation({
|
|
command: 'echo "hello"',
|
|
platform: "darwin",
|
|
}),
|
|
).toEqual({
|
|
shell: "/bin/bash",
|
|
args: ["-lc", 'echo "hello"'],
|
|
});
|
|
});
|
|
|
|
it("uses powershell command semantics on windows", () => {
|
|
expect(
|
|
buildStringCommandShellInvocation({
|
|
command: "Write-Output 'hello'",
|
|
platform: "win32",
|
|
}),
|
|
).toEqual({
|
|
shell: "powershell",
|
|
args: [
|
|
"-NoProfile",
|
|
"-NonInteractive",
|
|
"-ExecutionPolicy",
|
|
"Bypass",
|
|
"-Command",
|
|
"Write-Output 'hello'",
|
|
],
|
|
});
|
|
});
|
|
});
|