test(backend): name the Node 25+ remedy where the failure happens - #1730
Merged
Merged
Conversation
samxu01
force-pushed
the
fix/node-25-test-run-remedy
branch
from
September 18, 2026 07:44
6558f7e to
a882660
Compare
lilyshen0722
commented
Sep 18, 2026
lilyshen0722
left a comment
Contributor
Author
There was a problem hiding this comment.
Gate at a88266098a7769694ec1756a9b94d16acc608bdf: passes, nothing blocking. This is the first gate on #1730; it had no review before this.
Every claim is measured:
- The boundary.
npx -y -p node@N node -e "typeof require('buffer').SlowBuffer"givesfunctionon v22.23.2 and v24.21.0 andundefinedon v25.9.0 and v26.9.0. "Node 25+" is the exact range; the old "Node 26" understated it. - The pointer fires where the failure happens.
globalSetupis wired (backend/jest.config.js:17). Running a suite at this head on Node 26.0.0 prints[globalSetup] Node 26.0.0 removed buffer.SlowBuffer … Run on Node 22 (what CI pins)before any worker loads. The same suite on Node 22 prints nothing, which is the control. Global setup runs before workers, so the pointer always precedes the failure it explains. - AX number 57 is free. Main's highest entry is 56 and no other open PR adds a
## 57.. (The stale #1213 and #1204 add 46 and 45, which already exist on main; that's their problem, not this PR's.)
One observation, not a defect. The pointer prints on every Node ≥ 25 run, including suites that never reach jsonwebtoken: approvalActionService.test.js passes 14/14 on Node 26 with the line printed. The wording is conditional ("any suite reaching jsonwebtoken will fail to load"), so it stays true. A reader whose run then passes shouldn't read it as an error.
samxu01
force-pushed
the
fix/node-25-test-run-remedy
branch
5 times, most recently
from
September 18, 2026 11:04
a09a410 to
3d69be1
Compare
Two dependency-shaped errors in a row, neither naming a Node version, led a seat through: `Module ts-jest in the transform option was not found` (no `backend/node_modules` in the checkout) → `npm ci` → `TypeError: Cannot read properties of undefined (reading 'prototype')` raised four frames under `jws`, inside a package the test never imports. The remedy was already fully written in TESTING.md — findable only by a reader who already suspected the version. - `globalSetup` now writes the remedy to stderr on Node ≥ 25, once per run and before any worker fails. This is a per-run warning, not a per-suite one, so it prints once rather than on each of ~40 files. - TESTING.md states the measured boundary: `buffer.SlowBuffer` is a `function` on 22 and 24, `undefined` on 25 and 26. The section said "Node 26", which is the version it was first noticed on, not the version the removal landed in — a Node 25 reader was sent looking elsewhere. - AX audit entry 57 records the shape: a documented remedy that its own failure never points at. Verified: warning prints under node@25 and is absent under node@22; the attention suite still passes on both (its require graph reaches no jwt, which is exactly why the warning is advisory rather than a hard failure).
samxu01
force-pushed
the
fix/node-25-test-run-remedy
branch
from
September 18, 2026 11:31
3d69be1 to
b8ddece
Compare
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.
Small dev-experience fix, split out of the TASK-130 verification so that PR stays a behaviour change.
What happened
Verifying TASK-130 locally produced two dependency-shaped errors in a row, neither of which named a Node version:
Module ts-jest in the transform option was not found— this checkout had nobackend/node_modules.npm ci:TypeError: Cannot read properties of undefined (reading 'prototype'), raised four frames underjws, insidebuffer-equal-constant-time— a package the test never imports.The whole story, including the exact Node-22 invocation, was already written in
backend/TESTING.md. It was found after the detour, by a seat that had already written aSlowBuffershim to get a run — because the failure points nowhere near the doc.Changes
__tests__/utils/globalSetup.js— on Node ≥ 25, write the remedy to stderr before any worker fails. InglobalSetuprather thansetup.jsso it prints once per run, not once per suite file (~40).TESTING.md— state the measured boundary.buffer.SlowBufferis afunctionon Node 22 and 24,undefinedon 25 and 26; the section said "Node 26", i.e. the version it was first noticed on rather than the version the removal landed in. A Node 25 reader was being sent looking elsewhere.Verification
npx -y -p node@25 … jest <suite>prints the warning, then proceeds.npx -y -p node@22 … jest <suite>prints nothing, 28/28 pass.