From 5bd720e7668e68fbd69d077d46f43dd7ebbdd806 Mon Sep 17 00:00:00 2001 From: Jakob Heuser Date: Wed, 21 Oct 2026 01:48:25 -0700 Subject: [PATCH] test(init): assert the two-line onboarding trailer in tests that landed beside it #559 changed the trailer while two tests asserting the old sentence were landing on main, so main went red after the stack merged. The telemetry test now compares its last console.log entry with getOnboardTrailer(), and the commit-banner ordering test looks for ONBOARD_PROMPT. --- packages/cli/test/init-no-interactive.test.ts | 2 +- packages/cli/test/init-telemetry-notice.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/test/init-no-interactive.test.ts b/packages/cli/test/init-no-interactive.test.ts index 85bdb6a1..960e6a5c 100644 --- a/packages/cli/test/init-no-interactive.test.ts +++ b/packages/cli/test/init-no-interactive.test.ts @@ -665,7 +665,7 @@ describe("taskless init (the batch install)", () => { ); expect(boxed).not.toContain(".claude/skills/taskless"); expect(stdout.indexOf("COMMIT BEFORE YOU START YOUR AGENT")).toBeLessThan( - stdout.indexOf("ask to onboard with Taskless") + stdout.indexOf(ONBOARD_PROMPT) ); }); diff --git a/packages/cli/test/init-telemetry-notice.test.ts b/packages/cli/test/init-telemetry-notice.test.ts index 5761af1f..3834e7f7 100644 --- a/packages/cli/test/init-telemetry-notice.test.ts +++ b/packages/cli/test/init-telemetry-notice.test.ts @@ -19,6 +19,7 @@ vi.mock("../src/telemetry", () => ({ })); const { initCommand } = await import("../src/commands/init"); +const { getOnboardTrailer } = await import("../src/commands/onboard"); interface RunnableCommand { run: (context: { @@ -68,7 +69,9 @@ describe("init tells the user about telemetry", () => { expect(output.filter((line) => line === "")).toHaveLength( 1 ); - expect(output.at(-1)).toMatch(/^In your AI tool, /); + // One `console.log` call per entry, and the trailer is a single two-line + // call, so the last entry is the whole trailer. + expect(output.at(-1)).toBe(getOnboardTrailer()); expect(isTelemetryEnabled).toHaveBeenCalledWith(cwd); });