Skip to content

Commit b60e3e0

Browse files
betegonclaude
andcommitted
test(init): cover wizard.outcome:bailed when user declines experimental prompt
The !confirmed branch in preamble() was the one uncovered line in the patch (75% patch coverage). Adds a test that responds "exit" to the generic continue/exit select so that path executes. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent a12eba0 commit b60e3e0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/lib/init/wizard-runner.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,19 @@ describe("runWizard", () => {
453453
expect(formatResultSpy).toHaveBeenCalled();
454454
});
455455

456+
test("aborts cleanly when user declines the experimental prompt", async () => {
457+
const { ui, calls, respond } = createMockUI();
458+
respond.select("exit");
459+
useMockUI(ui, calls);
460+
461+
await forceStdinTty(() => runWizard(makeOptions({ yes: false })));
462+
463+
expect(process.exitCode).toBe(0);
464+
expect(lastCancelMessage()).toBe("Setup cancelled.");
465+
expect(lastFeedbackOutcome()).toBe("cancelled");
466+
expect(getWorkflowSpy).not.toHaveBeenCalled();
467+
});
468+
456469
test("stops before workflow creation when preflight returns null", async () => {
457470
resolveInitContextSpy.mockResolvedValue(null);
458471

0 commit comments

Comments
 (0)