test(changelog): assert the bump, and prove the control can fail - #48
Conversation
The check covered which sections render and nothing else. Flip `chore` from `effect: "changelog"` to `effect: "bump"` and it still passes clean, because the type keeps rendering and no assertion looks at the version. That is the exact failure `effect` exists to prevent: a month of dependency chores driving a release past a patch. So it now measures the bump through conventional-recommended-bump against the same preset: feat! is a major, feat a minor, fix a patch, and build/refactor/chore/docs together are no release at all. The chore-to-bump sabotage fails on `build/refactor/chore/docs alone do not bump (got patch)`. The policy also moves into POLICY, stated longhand, and the type list is asserted against it. Before, a type could drift in the list and only be caught indirectly, through whatever it did to the rendered output. Last, a negative control: the same synthetic history rendered through a type list with every visible type forced to `hidden`, failing if that run passes. An assertion that cannot fail is worth nothing, and this keeps proving these can. Changelog output is untouched. tools/changelog.mjs regenerates CHANGELOG.md byte-identical, and tools/changelog-history.md still freezes everything at and below 1.3.0.
|
🎉 Congratulations on making your first pull request in '@gstj/safe-jsx'! We appreciate your contribution and will review it as soon as possible. Thank you for helping us make this project better. |
|
Reviewed and verified locally. The premise holds. I flipped The bump semantics are right, and each assertion falls over on its own: flipping Nothing blocking. The negative control only wraps Separately, resolving the CLI through Merging. |

Flip
chorefromeffect: "changelog"toeffect: "bump"intools/changelog-preset.mjsandpnpm run changelog:checkpasses clean. The type keeps rendering, so every existing assertion holds, and nothing looks at the version. That is the failureeffectwas added to prevent: a month of dependency chores driving a release past a patch.Bump
The check now measures it, through
conventional-recommended-bumpagainst the same preset the release uses.feat!major,featminor,fixpatch, andbuild/refactor/chore/docstogether no release at all. The sabotage above now fails onbuild/refactor/chore/docs alone do not bump (got patch). That number comes from running the bumper.Policy
POLICYstates each type's effect longhand, and the type list is asserted against it. Before, a type could drift in the list and only get caught sideways, through whatever it happened to do to the rendered output.The section assertions still fail when they should: hiding
chorefailed before this change and fails now.Negative control
The same synthetic history rendered through a type list with every visible type forced to
hidden, failing if that run passes. All three breaking-change assertions still hold under that sabotage, theci!:one included, because the writer un-discards any commit carrying a note whatever type it hangs off.Changelog output
Untouched.
node tools/changelog.mjsrebuilds CHANGELOG.md byte-identical (same md5 either side), andtools/changelog-history.mdis still embedded verbatim, so nothing at or below the 1.3.0 freeze moved.No release
Rehearsed with
npm version patchon a throwaway clone: 1.3.5 -> 1.3.6, zero lines removed from CHANGELOG.md, annotated tag built from the new section. The 1.3.6 section comes out empty, sincetest:is a hidden type.