mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-30 17:37:34 +08:00
18 lines
612 B
TypeScript
18 lines
612 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import path from "path"
|
|
import { resolveGitExecutable } from "@opencode/core/util/git-executable"
|
|
|
|
describe("Git executable", () => {
|
|
test("uses an absolute executable on Windows", () => {
|
|
expect(resolveGitExecutable("win32", "bin/git.exe")).toBe(path.resolve("bin/git.exe"))
|
|
})
|
|
|
|
test("leaves lookup to the process outside Windows", () => {
|
|
expect(resolveGitExecutable("linux", "/usr/bin/git")).toBe("git")
|
|
})
|
|
|
|
test("falls back to PATH lookup when Git is unresolved", () => {
|
|
expect(resolveGitExecutable("win32", null)).toBe("git")
|
|
})
|
|
})
|