fix(test): build before every runner, and correct the guide - #10
Merged
Conversation
The `ts/` runners executed a build output that nothing rebuilt, so an edit that was never compiled still reported green — and on a fresh checkout they failed for want of `dist-test/`. Hooks added: pretest, pretest-some, pretest-watch. Every runner gets its own, because npm runs `pre<name>` only for the script whose name matches exactly: a single `pretest` does nothing for `test-some`, `test-watch` or `test-cov`, and a focused run is what you reach for while iterating on one test. AGENTS.md already described this hazard and asked contributors to work around it by typing `npm run build && npm test`. Documenting a trap is not fixing it, and across this fleet it is what kept the trap alive — the paragraph made a defect read as an accepted condition. The wiring is fixed instead, and the guide now records why the old instruction is gone. Verified: `npm test` in `ts/` — 186 pass, 0 fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ts/had nopretestat all.npm testran the compileddist-test/*.test.jsand compiled nothing, so an edit that was never built still reported green — and on a fresh checkout the suite failed for want ofdist-test/.Hooks added:
pretest,pretest-some,pretest-watch— allnpm run build.Every runner gets its own, because npm runs
pre<name>only for the script whose name matches exactly. A singlepretestdoes nothing fortest-someortest-watch, and a focused run is what you reach for while iterating on one test.Why the guide changed too
AGENTS.mdalready described this hazard and asked contributors to work around it by typingnpm run build && npm test. Documenting a trap is not fixing it — and across this fleet it is what kept the trap alive, because the paragraph made a defect read as an accepted condition. The wiring is fixed instead; the guide now says the suite compiles first, and records why the old instruction is gone.Verification
npm testints/: 186 pass, 0 fail.make ax-stale-test-artifactintabnas/adminwent from flagging this repo to passing it. The failing "before" state was measured, not assumed — the fleet sweep reported 13 of 22 repos building before they test, and 22 of 22 after.Part of the TS/Go parity programme; the same change is going out across every fleet repo that shared this wiring.
Generated by Claude Code