fix: Windows test compat — shell quoting, line endings, binary names
- Replace single-quoted git commit messages in worktree tests with double quotes (cmd.exe doesn't treat single quotes as delimiters) - Trim stdout in spawn tests to handle \r\n vs \n - Use nonexistent binary name in executable test not-found case
This commit is contained in:
@@ -16,10 +16,10 @@ describe("execCommand", () => {
|
||||
});
|
||||
|
||||
test("returns stdout and stderr for a successful command", async () => {
|
||||
await expect(execCommand("echo", ["hello"])).resolves.toEqual({
|
||||
stdout: "hello\n",
|
||||
stderr: "",
|
||||
});
|
||||
const result = await execCommand("echo", ["hello"]);
|
||||
|
||||
expect(result.stdout.trim()).toBe("hello");
|
||||
expect(result.stderr).toBe("");
|
||||
});
|
||||
|
||||
test("rejects when the command times out", async () => {
|
||||
@@ -46,9 +46,9 @@ describe("execCommand", () => {
|
||||
}
|
||||
: { command: "pwd", args: [] };
|
||||
|
||||
await expect(execCommand(command.command, command.args, { cwd })).resolves.toEqual({
|
||||
stdout: `${cwd}\n`,
|
||||
stderr: "",
|
||||
});
|
||||
const result = await execCommand(command.command, command.args, { cwd });
|
||||
|
||||
expect(result.stdout.trim()).toBe(cwd);
|
||||
expect(result.stderr).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user