From 9d658d767ab9865a17c37f2b8649a9f337f3978e Mon Sep 17 00:00:00 2001 From: GamerDubz Date: Tue, 13 Oct 2026 14:52:24 +0200 Subject: [PATCH] test(release): check every versioned example block in the installation guide The conformance test read only the first Release Please version block, so adding the plugin readiness block ahead of the MCP Registry example left the registry example unchecked. Check every block, and require each known example to sit inside exactly one, so a stale version or a lost marker in any of them fails. Co-Authored-By: Claude Opus 5.5 --- .../conformance/releaseConfiguration.test.ts | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tests/conformance/releaseConfiguration.test.ts b/tests/conformance/releaseConfiguration.test.ts index 57b81e3af..5d72c4114 100644 --- a/tests/conformance/releaseConfiguration.test.ts +++ b/tests/conformance/releaseConfiguration.test.ts @@ -8,7 +8,14 @@ import { MCP_STARTUP_POLICY } from "../../src/mcpStartupPolicy.js"; const readJson = async (path: string): Promise => JSON.parse(await readFile(path, "utf8")) as unknown; -const versionedDocumentation = ["docs/installation.md"] as const; +// Each file lists a fragment of every example Release Please must keep +// current, so a lost marker is caught as well as a stale version. +const versionedDocumentation = [ + { + path: "docs/installation.md", + examples: ["doctor --provider ghidra --json", '"command": "npx"'], + }, +] as const; const pluginManifests = [ ".claude-plugin/plugin.json", ".codex-plugin/plugin.json", @@ -29,7 +36,7 @@ describe("release configuration", () => { packages: { ".": { "extra-files": [ - ...versionedDocumentation.map((path) => ({ + ...versionedDocumentation.map(({ path }) => ({ type: "generic", path, })), @@ -61,18 +68,27 @@ describe("release configuration", () => { }); it.each(versionedDocumentation)( - "marks the versioned package example in %s", - async (path) => { + "marks every versioned package example in $path", + async ({ path, examples }) => { const content = await readFile(path, "utf8"); const packageJson = (await readJson("package.json")) as { version: string; }; - const versionBlock = - /[\s\S]*?/u.exec( - content, - )?.[0]; + const versionBlocks = [ + ...content.matchAll( + /[\s\S]*?/gu, + ), + ].map(([block]) => block); - expect(versionBlock).toContain(`rea-agents@${packageJson.version}`); + for (const example of examples) + expect( + versionBlocks.filter((block) => block.includes(example)), + example, + ).toHaveLength(1); + for (const block of versionBlocks) + expect(block.match(/rea-agents@[^\s"`]+/gu)).toEqual([ + `rea-agents@${packageJson.version}`, + ]); }, );