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:
Mohamed Boudra
2026-04-13 20:36:59 +07:00
parent 6dfcb4daa9
commit 61201d68a6
3 changed files with 38 additions and 37 deletions
+2 -1
View File
@@ -49,6 +49,7 @@ async function loadExecutableModule(params?: {
describe("findExecutable", () => {
const originalPlatform = process.platform;
const missingBinaryName = "nonexistent-binary-xyz-12345";
function setPlatform(value: string) {
Object.defineProperty(process, "platform", { value, writable: true });
@@ -118,7 +119,7 @@ describe("findExecutable", () => {
},
});
await expect(findExecutable("codex")).resolves.toBeNull();
await expect(findExecutable(missingBinaryName)).resolves.toBeNull();
});
test("on Windows, falls back to the first extensionless candidate when needed", async () => {