voyage/tests/helpers
Kjell Tore Guttormsen b79495847d
test(changelog): find the 6.4.0 section by its title, before and after the release commit
Two docs tests located this delivery's CHANGELOG section by the literal
heading `## Unreleased` (one also required it to be the first section).
The release commit renames it to `## v6.4.0 — <date> — <title>`
(docs/release-runbook.md § 1.4), so all 16 content pins failed on the
release commit while the content was the same.

One shared helper, tests/helpers/changelog-section.mjs, now finds the
section by its title under either heading, wherever it stands (a later
delivery's section above it does not move the pins), with a trailing \r or
spaces tolerated, and only when it stands exactly once. Every content
assertion is unchanged; their messages no longer say "Unreleased". New
tests pin the accepted headings and seven near misses (version, date,
title, the literal dot in 1.9), and the helper on a later section, a \r,
a duplicate and a missing section.

Measured: 46/46 pass against main's CHANGELOG and against the release
commit's CHANGELOG; before the change, 16 failed on the release commit.
Three mutants of the helper (a looser date, no escaping, no trim) are
each failed by one test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:13:32 +02:00
..
artifact-repo.mjs refactor(simplify): one source per rule, shared test helpers, a faster isolation test [skip-docs] 2026-10-12 21:06:47 +02:00
bin-path.mjs fix: round 9 of the release review of 6.3.0, for 6.3.1 2026-10-11 12:49:01 +02:00
changelog-section.mjs test(changelog): find the 6.4.0 section by its title, before and after the release commit 2026-10-17 00:13:32 +02:00
child-env.mjs fix(tests): the suite no longer hands the session id to the lock CLI 2026-10-12 14:09:14 +02:00
hook-helper.mjs fix(tests): the post-compact hook test takes its child timeout from the shared timing helper 2026-10-15 15:43:36 +02:00
no-session-id.mjs fix(tests): the suite no longer hands the session id to the lock CLI 2026-10-12 14:09:14 +02:00
plan-v18-builder.mjs feat(plan): read Files by the 1.9 grammar, warn on unticked paths below it [skip-docs] 2026-10-12 16:09:25 +02:00
timing.mjs fix(tests): the post-compact hook test takes its child timeout from the shared timing helper 2026-10-15 15:43:36 +02:00