fix: skip bash-dependent tests on Windows, fix platform-aware assertions

- Skip worktree test suite on Windows (uses bash shell syntax)
- Skip ~ home-root directory test on Windows
- Make findExecutable mock assertions platform-aware (which vs where.exe)
- Use nonexistent binary name for not-found test case
This commit is contained in:
Mohamed Boudra
2026-04-13 20:46:10 +07:00
parent 61201d68a6
commit 4806cd9a51
3 changed files with 7 additions and 5 deletions
@@ -4,6 +4,8 @@ import path from "node:path";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { searchHomeDirectories, searchWorkspaceEntries } from "./directory-suggestions.js";
const isWindows = process.platform === "win32";
describe("searchHomeDirectories", () => {
let tempRoot: string;
let homeDir: string;
@@ -101,7 +103,7 @@ describe("searchHomeDirectories", () => {
expect(earlierIndex).toBeLessThan(laterIndex);
});
it("returns home-root suggestions when query is '~'", async () => {
it.skipIf(isWindows)("returns home-root suggestions when query is '~'", async () => {
const results = await searchHomeDirectories({
homeDir,
query: "~",