Skip to content

fix(test): build before every runner, and correct the guide - #10

Merged
rjrodger merged 1 commit into
mainfrom
claude/build-before-test-l6cbua
Aug 20, 2026
Merged

fix(test): build before every runner, and correct the guide#10
rjrodger merged 1 commit into
mainfrom
claude/build-before-test-l6cbua

Conversation

@rjrodger

Copy link
Copy Markdown
Contributor

What

ts/ had no pretest at all. npm test ran the compiled dist-test/*.test.js and compiled nothing, so an edit that was never built still reported green — and on a fresh checkout the suite failed for want of dist-test/.

Hooks added: pretest, pretest-some, pretest-watch — all npm run build.

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 or test-watch, and a focused run is what you reach for while iterating on one test.

Why the guide changed too

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, 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 test in ts/: 186 pass, 0 fail.
  • make ax-stale-test-artifact in tabnas/admin went 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

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.
@rjrodger
rjrodger merged commit 378d0dd into main Aug 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants