Repository navigation
test(cli): the kept-value cases that read a value back skip on a Node without module hooks - #12353
Conversation
… without module hooks A run keeps catalogs only through module.registerHooks, which Node has from 22.15 and 23.5. On Node 22.13, the oldest the CLI supports, every value is worked out and nothing is kept, by design, so the three cases that read a kept value back failed there. They now skip on that Node, as gather-cache.test.mjs already does.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec d299da1 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI: the required checks are still running on this head.
The change does what it says: on Node 22.13.0 the three read-back cases now skip instead of failing, the three nothing-kept cases still pass, and on current Node all six cases run and pass. No product code, public API or spec record changes. The daily minimum-Node run on main also fails in other test files and its global-mode smoke today, so this change alone will not turn that run green.
Claims and files checked
Review mode: same-head; reason: none
- Claim: on Node 22.13.0, the oldest Node the CLI supports, the three named cases fail with the three quoted errors and keep the daily minimum-Node run red: verified (
engines.nodeis>=22.13.0; reproduced at the base on 22.13.0; the latest daily run reports the same three failures, beside failures in other files). - Claim: a run keeps catalogs only through
module.registerHooks, which Node has from 22.15 and 23.5, and without it every value is worked out and nothing is kept: verified (gather-cache.mjs:374-375and:1145). - Claim:
gather-cache.test.mjsalready skips its kept-run cases the same way: verified (gather-cache.test.mjs:17-23). - Claim: the three cases use
it.skipIf(!hasModuleHooks)with the shared helper and a comment, and the other three still run on every Node: verified (lines 15, 103-107, 170 and 192; the other three pass on 22.13.0). - Claim: users of Node 22.13 lose nothing and no product file changes: verified (only this test file changes).
- Claim: the cases came in with #12166: verified (the file's history).
- Claim: Node 22.13.0 gives 3 passed and 3 skipped, against 3 failed and 3 passed before: verified (reproduced, also with this change merged into current
main). - Claim: on current Node the three cases run as before and pass on Linux: verified (Node 24.20.0 on Linux, 6 passed); the macOS failure at the base was not reproduced and is outside this change.
- Claim: #12219 edits
gather-cache.mjs, not this test file: verified (its file list). - File
packages/cli/foundation/fs/gather-cache.value.test.mjs: clear; consistent with the unchangedtest-utils/module-hooks.mjsandgather-cache.mjs.
Maintainer impact
On Node 22.13.0, the oldest Node the CLI supports, three cases in
packages/cli/foundation/fs/gather-cache.value.test.mjsfail (expected 2 to be 1,expected 3 to be 2, andThe "path" argument must be … Received undefined). That keeps the daily minimum-Node run red. The cases are:Intended invariant
Users of 22.13 lose nothing.
recordRun()ingather-cache.mjskeeps catalogs only throughmodule.registerHooks, which Node has from 22.15 and 23.5. Without it, the run works out every value and keeps nothing, by design (if (typeof registerHooks !== 'function' …) return fn()): the answers are the same, only uncached. The three cases read a kept value back, so on 22.13 there is nothing to read.gather-cache.test.mjsalready skips its own kept-run cases the same way.Change
it.skipIf(!hasModuleHooks), with the sharedhasModuleHooksfromtest-utils/module-hooks.mjs, and a comment says why. The three cases that check what happens outside a kept run, or when nothing is kept, still run on every Node.The cases came in with #12166, which added this test file.
Scope
Testing
Overlap checked: #12219 (it edits
gather-cache.mjs, not this test file)Owner: fix-loop lane 4. Land path: Specs ledger row, CodeBunny, CI, then the drain merges.