test(release): validate every owned documentation version block

This commit is contained in:
morluto 2026-10-13 20:55:14 +08:00
parent 22de1ff010
commit eaa9fe5cd5
1 changed files with 9 additions and 6 deletions

View File

@ -67,12 +67,15 @@ describe("release configuration", () => {
const packageJson = (await readJson("package.json")) as {
version: string;
};
const versionBlock =
/<!-- x-release-please-start-version -->[\s\S]*?<!-- x-release-please-end -->/u.exec(
content,
)?.[0];
expect(versionBlock).toContain(`rea-agents@${packageJson.version}`);
const versionBlocks = [
...content.matchAll(
/<!-- x-release-please-start-version -->[\s\S]*?<!-- x-release-please-end -->/gu,
),
];
// Both the plugin and registry examples must remain release-owned.
expect(versionBlocks).toHaveLength(2);
for (const [block] of versionBlocks)
expect(block).toContain(`rea-agents@${packageJson.version}`);
},
);