feat(FN-4717): complete Step 3 — widen worktrunk installer contract
Fusion-Task-Id: FN-4717 Fusion-Task-Lineage: a2533cd8-52c4-43a0-9daf-e0a49745306b
This commit is contained in:
committed by
gsxdsm
parent
f02482f8f3
commit
3f77bc2534
@@ -1,5 +1,6 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import type { WorktrunkSettings } from "@fusion/core";
|
||||
import type { AgentActionGateContext } from "../agent-action-gate.js";
|
||||
import type { RunAuditor } from "../run-audit.js";
|
||||
|
||||
vi.mock("node:child_process", () => ({
|
||||
@@ -173,6 +174,19 @@ describe("worktrunk-installer", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("accepts actionGateContext and preserves current disabled-install behavior", async () => {
|
||||
mockExecSequence([{ stdout: "worktrunk 0.4.2\n" }]);
|
||||
const result = await resolveWorktrunkBinary({
|
||||
settings: makeSettings({ binaryPath: "/opt/worktrunk" }),
|
||||
actionGateContext: {} as AgentActionGateContext,
|
||||
});
|
||||
|
||||
const _sourceUnionAssertion: {
|
||||
source: "override" | "path" | "cached" | "installed-release" | "installed-cargo";
|
||||
} = result;
|
||||
expect(_sourceUnionAssertion.source).toBe("override");
|
||||
});
|
||||
|
||||
it("resolveWorktrunkBinary resolves PATH hit when override is absent", async () => {
|
||||
mockExecSequence([
|
||||
{ stdout: "/usr/bin/worktrunk\n" },
|
||||
|
||||
Reference in New Issue
Block a user