From 6bf51fd9923d6483738bd7a07ae4398b6734b118 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Sun, 1 Mar 2026 10:48:16 -0800 Subject: [PATCH] fix(test): use path.resolve in tilde expansion test for Windows compat expandHomePrefix resolves HOME through platform-native path normalization, producing drive-letter paths on Windows (e.g. C:\tmp\...). The test was comparing against the raw POSIX string, causing CI failure on Windows shard 1/2. Use path.resolve(fakeHome) for the expected value so it matches on all platforms. No-op on POSIX where resolve('/tmp/...') === '/tmp/...'. --- src/infra/fs-safe.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/infra/fs-safe.test.ts b/src/infra/fs-safe.test.ts index 03a2888aa72..481991661c9 100644 --- a/src/infra/fs-safe.test.ts +++ b/src/infra/fs-safe.test.ts @@ -182,7 +182,8 @@ describe("tilde expansion in file tools", () => { process.env.HOME = fakeHome; try { const result = expandHomePrefix("~/file.txt"); - expect(result).toBe(`${fakeHome}/file.txt`); + // path.resolve produces platform-native paths (e.g. C:\tmp\... on Windows) + expect(result).toBe(`${path.resolve(fakeHome)}/file.txt`); } finally { process.env.HOME = originalHome; }