The legacy and auto e2e cases both connect to the legacy stdio fixture
whether or not the flag reaches negotiation, since auto falls back. Run
initialize against an HTTP test server that rejects the legacy handshake:
the default must fail, and --protocol-era modern must connect and report
the 2026-07-28 protocol version. Deleting the serverOptions assignment in
cli.ts now fails this case (Copilot review, PR #2372).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZ4rrvH6xaCfrst75gJh7x
Signed-off-by: cliffhall <cliff@futurescale.com>
Most tests import runCli()in-process (see helpers/cli-runner.ts) so
clients/cli/src is measured under the coverage gate. Suite-wide
helpers/mock-open-url.ts (vitest setupFiles) mocks open-url so an armed
interactive OAuth path cannot launch a real browser.
e2e.test.ts (and root scripts/smoke-cli.mjs) spawn the built binary for
shebang / process.exit paths — pretest builds test-servers + the CLI
bundle first.
Scripts (from clients/cli/)
npm test# pretest build + all tests
npm run test:cli # subset: cli.test.ts
npm run test:cli-tools # subset: tools.test.ts
npm run test:cli-headers # subset: headers.test.ts
npm run test:cli-metadata # subset: metadata.test.ts
npm run test:coverage # build + ≥90 per-file coverage gate
npm run validate # format:check && lint && typecheck && test