Files
oh-my-pi/packages/coding-agent/test/update-cli.test.ts
T
can1357 b0fef96800 fix(coding-agent): harden omp update install-target detection
Use Bun-native command execution and PATH-prioritized resolution so updates apply to the installation users actually invoke.\n\nFixes #247
2026-03-03 05:29:26 +01:00

23 lines
811 B
TypeScript

import { describe, expect, it } from "bun:test";
import { _resolveUpdateMethodForTest } from "../src/cli/update-cli";
describe("update-cli install target detection", () => {
it("uses bun update when prioritized omp is inside bun global bin", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.bun/bin/omp", "/Users/test/.bun/bin");
expect(method).toBe("bun");
});
it("uses binary update when prioritized omp is outside bun global bin", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.local/bin/omp", "/Users/test/.bun/bin");
expect(method).toBe("binary");
});
it("uses binary update when bun global bin cannot be resolved", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.local/bin/omp", undefined);
expect(method).toBe("binary");
});
});