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/...'.
This commit is contained in:
Josh Lehman
2026-03-01 10:48:16 -08:00
parent 134296276a
commit 6bf51fd992

View File

@@ -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;
}