Unified · Split
| @@ -39,9 +39,9 @@ describe("xdgDataHome", () => { · 38 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | test("ignores empty / whitespace-only XDG_DATA_HOME", () => { |
| 41 | 41 | vi.stubEnv("XDG_DATA_HOME", " "); |
| 42 | − vi.stubEnv("HOME", "/home/rhys"); | |
| 42 | + vi.stubEnv("HOME", "/home/user"); | |
| 43 | 43 | stubPlatform("linux"); |
| 44 | − expect(xdgDataHome()).toBe("/home/rhys/.local/share"); | |
| 44 | + expect(xdgDataHome()).toBe("/home/user/.local/share"); | |
| 45 | 45 | }); |
| 46 | 46 | |
| 47 | 47 | test("trims whitespace around XDG_DATA_HOME", () => { |
| @@ -54,8 +54,8 @@ describe("xdgDataHome", () => { · 6 unmodified lines | ||
| 54 | 54 | beforeEach(() => stubPlatform("linux")); |
| 55 | 55 | |
| 56 | 56 | test("falls back to $HOME/.local/share", () => { |
| 57 | − vi.stubEnv("HOME", "/home/rhys"); | |
| 58 | − expect(xdgDataHome()).toBe("/home/rhys/.local/share"); | |
| 57 | + vi.stubEnv("HOME", "/home/user"); | |
| 58 | + expect(xdgDataHome()).toBe("/home/user/.local/share"); | |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | 61 | test("defaults to ~/.local/share when HOME is unset", () => { |
| @@ -67,25 +67,25 @@ describe("xdgDataHome", () => { · 5 unmodified lines | ||
| 67 | 67 | beforeEach(() => stubPlatform("win32")); |
| 68 | 68 | |
| 69 | 69 | test("prefers LOCALAPPDATA", () => { |
| 70 | − vi.stubEnv("LOCALAPPDATA", "C:\\Users\\rhys\\AppData\\Local"); | |
| 71 | − vi.stubEnv("APPDATA", "C:\\Users\\rhys\\AppData\\Roaming"); | |
| 72 | − vi.stubEnv("USERPROFILE", "C:\\Users\\rhys"); | |
| 73 | − expect(xdgDataHome()).toBe("C:\\Users\\rhys\\AppData\\Local"); | |
| 70 | + vi.stubEnv("LOCALAPPDATA", "C:\\Users\\user\\AppData\\Local"); | |
| 71 | + vi.stubEnv("APPDATA", "C:\\Users\\user\\AppData\\Roaming"); | |
| 72 | + vi.stubEnv("USERPROFILE", "C:\\Users\\user"); | |
| 73 | + expect(xdgDataHome()).toBe("C:\\Users\\user\\AppData\\Local"); | |
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | 76 | test("falls back to APPDATA when LOCALAPPDATA is unset", () => { |
| 77 | − vi.stubEnv("APPDATA", "C:\\Users\\rhys\\AppData\\Roaming"); | |
| 78 | − vi.stubEnv("USERPROFILE", "C:\\Users\\rhys"); | |
| 79 | − expect(xdgDataHome()).toBe("C:\\Users\\rhys\\AppData\\Roaming"); | |
| 77 | + vi.stubEnv("APPDATA", "C:\\Users\\user\\AppData\\Roaming"); | |
| 78 | + vi.stubEnv("USERPROFILE", "C:\\Users\\user"); | |
| 79 | + expect(xdgDataHome()).toBe("C:\\Users\\user\\AppData\\Roaming"); | |
| 80 | 80 | }); |
| 81 | 81 | |
| 82 | 82 | test("falls back to USERPROFILE\\AppData\\Local when both are unset", () => { |
| 83 | − vi.stubEnv("USERPROFILE", "C:\\Users\\rhys"); | |
| 83 | + vi.stubEnv("USERPROFILE", "C:\\Users\\user"); | |
| 84 | 84 | // The helper uses node:path.join which normalizes separators to the |
| 85 | 85 | // runtime platform, so on a POSIX test runner we can't assert the |
| 86 | 86 | // exact separator — just that all three segments are present. |
| 87 | 87 | const result = xdgDataHome(); |
| 88 | − expect(result).toContain("C:\\Users\\rhys"); | |
| 88 | + expect(result).toContain("C:\\Users\\user"); | |
| 89 | 89 | expect(result).toContain("AppData"); |
| 90 | 90 | expect(result).toContain("Local"); |
| 91 | 91 | }); |