b0fef96800
Use Bun-native command execution and PATH-prioritized resolution so updates apply to the installation users actually invoke.\n\nFixes #247
23 lines
811 B
TypeScript
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");
|
|
});
|
|
});
|