Skip to content

Commit f88cd23

Browse files
sahrizviclaude
andcommitted
test: build the bin-dir paths with the host path module
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011chv9Rmu7jQXokum1WNcs7
1 parent 3a254af commit f88cd23

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎packages/opencode/test/cli/uninstall-hint.test.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { describe, expect, test } from "bun:test"
2+
import path from "path"
23
import {
34
installerSiblingFiles,
45
removalHeader,
@@ -101,10 +102,13 @@ describe("uninstall — removal header and empty-directory command", () => {
101102
})
102103

103104
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()
109113
})
110114
})

0 commit comments

Comments
 (0)