Commit ddc9edb
committed
test(ci): fixture the no-major changeset guard and wire it into the exemption-free self-test step (#6923)
`scripts/check-changeset-no-major.mjs` was the one member of the changeset-gate
family with no `--self-test`, which is why PR #6917 could not wire it into
`lint.yml` alongside the other two. Refactor it into a pure `judge()` plus a
pure `render()` (verdict -> lines + exit code), add 70 fixtures, and add the
script to `check:changeset-gate-self-tests`.
The fixtures were measured against `@changesets/parse@0.4.3` rather than
reasoned about, and that measurement found a real divergence: the parser
required its fence on line 1, so a changeset opening with a blank line declared
nothing to this guard while changesets honoured its `major` and would have
promoted the whole lockstep group. Both sibling parsers already skipped leading
blanks, and all three carry a comment claiming the three read the same block --
so this was also the one place that comment was false. Fixed, and pinned.
The enforcing half is still unexecuted on CI: `.changeset/pre.json` is
`"mode": "pre"`, so the real scan takes the exemption branch on every run. What
changed is that `enforce` is now produced by fixtures on every PR, in a job with
no label exemption. Fixtured is not executed, and the header says so.
Also corrects `check-empty-changeset.mjs`, whose consumer assertion stated in
its own message that this script is "deliberately absent: it has no
`--self-test` to run" -- true when #6917 wrote it, false as of this commit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn1 parent 63f3b87 commit ddc9edb
3 files changed
Lines changed: 580 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments