From 1d4e9f31c344d9dde1fdbfed0fbae61a3d48a3ca Mon Sep 17 00:00:00 2001 From: Can <159528514+eco-null@users.noreply.github.com> Date: Fri, 6 Nov 2026 10:14:43 +0300 Subject: [PATCH] test(cli): cover production doctor output option ordering (#6683) * fix(cli): retain production doctor output routing * test(reference): return byte-preserving entry names * fix(javascript): coalesce projected source facts * test: repair isolation and format fixtures * fix(evidence): retain rebound snapshot proof Carry immutable member proof across caller and target path rebinding so low-headroom error projection reuses completed Evidence without cloning its payload. --------- Co-authored-by: eco-null --- tests/boundary/cli/mcpDoctorHelpCli.test.ts | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/boundary/cli/mcpDoctorHelpCli.test.ts b/tests/boundary/cli/mcpDoctorHelpCli.test.ts index abf2e40c31..60a561274f 100644 --- a/tests/boundary/cli/mcpDoctorHelpCli.test.ts +++ b/tests/boundary/cli/mcpDoctorHelpCli.test.ts @@ -5,6 +5,45 @@ import { workspaceCliTest } from "../../support/cli/workspaceCliFixture.js"; const CLI_INTEGRATION_TIMEOUT_MS = 60_000; describe("MCP doctor help boundary", () => { + workspaceCliTest( + "keeps output options from selecting the CLI-derived MCP doctor", + async ({ cli }) => { + for (const arguments_ of [ + ["mcp", "doctor", "--json"], + ["--json", "mcp", "doctor"], + ["mcp", "--json", "doctor"], + ["--format", "json", "mcp", "doctor"], + ["mcp", "--format", "json", "doctor"], + ["--format=json", "mcp", "doctor"], + ["mcp", "--format=json", "doctor"], + ["--full-output", "mcp", "--json", "doctor"], + ]) { + const result = await cli.run({ + arguments: arguments_, + environment: { REA_MCP_DOCTOR_DEADLINE_MS: "0" }, + }); + expect(result.exitCode, arguments_.join(" ")).toBe(1); + const report = { + healthy: false, + adapter: "production-stdio", + checks: [ + expect.objectContaining({ + name: "REA_MCP_DOCTOR_DEADLINE_MS", + ok: false, + }), + ], + }; + expect(result.json).toMatchObject( + arguments_.includes("--full-output") + ? { ok: false, error: report } + : report, + ); + expect(result.stderr).toBe(""); + } + }, + CLI_INTEGRATION_TIMEOUT_MS, + ); + workspaceCliTest( "answers the advertised help option instead of validating it", async ({ cli }) => {