(
existing: Set<string>,
platform: NodeJS.Platform = "darwin",
onPath: (b: string) => string | null = () => null,
)
| 12 | // Build hermetic deps over a virtual set of "existing" paths and a fixed OS, so |
| 13 | // no host filesystem / real `opencode` install can leak into the result. |
| 14 | function deps( |
| 15 | existing: Set<string>, |
| 16 | platform: NodeJS.Platform = "darwin", |
| 17 | onPath: (b: string) => string | null = () => null, |
| 18 | ): DetectDeps { |
| 19 | return { |
| 20 | exists: (p) => existing.has(p), |
| 21 | home: HOME, |
| 22 | platform, |
| 23 | env: { |
| 24 | APPDATA: join(HOME, "AppData", "Roaming"), |
| 25 | LOCALAPPDATA: join(HOME, "AppData", "Local"), |
| 26 | USERPROFILE: HOME, |
| 27 | XDG_CONFIG_HOME: join(HOME, ".config"), |
| 28 | XDG_DATA_HOME: join(HOME, ".local", "share"), |
| 29 | }, |
| 30 | onPath, |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | describe("detectOpenCode", () => { |
| 35 | it("exposes exactly the three Desktop channel appIds", () => { |
no test coverage detected