|
1 | 1 | import { describe, expect, test } from "bun:test" |
| 2 | +import path from "path" |
2 | 3 | import { |
3 | 4 | installerSiblingFiles, |
4 | 5 | removalHeader, |
@@ -101,10 +102,13 @@ describe("uninstall — removal header and empty-directory command", () => { |
101 | 102 | }) |
102 | 103 |
|
103 | 104 | test("the empty bin directory is offered for the installers' ~/.altimate/bin and a legacy ~/.opencode/bin only", () => { |
104 | | - expect(emptyBinDirToRemove("/home/dev/.altimate/bin/altimate")).toBe("/home/dev/.altimate/bin") |
105 | | - expect(emptyBinDirToRemove("/home/dev/.opencode/bin/opencode")).toBe("/home/dev/.opencode/bin") |
106 | | - expect(emptyBinDirToRemove("/usr/local/bin/altimate")).toBeUndefined() |
107 | | - expect(emptyBinDirToRemove("/home/dev/.altimate/other/altimate")).toBeUndefined() |
108 | | - expect(emptyBinDirToRemove("/home/dev/my.opencode.tools/bin/altimate")).toBeUndefined() |
| 105 | + const home = path.join(path.sep, "home", "dev") |
| 106 | + const altimateBin = path.join(home, ".altimate", "bin") |
| 107 | + const opencodeBin = path.join(home, ".opencode", "bin") |
| 108 | + expect(emptyBinDirToRemove(path.join(altimateBin, "altimate"))).toBe(altimateBin) |
| 109 | + expect(emptyBinDirToRemove(path.join(opencodeBin, "opencode"))).toBe(opencodeBin) |
| 110 | + expect(emptyBinDirToRemove(path.join(path.sep, "usr", "local", "bin", "altimate"))).toBeUndefined() |
| 111 | + expect(emptyBinDirToRemove(path.join(home, ".altimate", "other", "altimate"))).toBeUndefined() |
| 112 | + expect(emptyBinDirToRemove(path.join(home, "my.opencode.tools", "bin", "altimate"))).toBeUndefined() |
109 | 113 | }) |
110 | 114 | }) |
0 commit comments