Skip to content

test: accept the current V8 error wording and run CI on Node 18-24 - #3484

Open
seebaermichi wants to merge 2 commits into
pugjs:masterfrom
seebaermichi:a2-v8-node-matrix
Open

seebaermichi wants to merge 2 commits into
pugjs:masterfrom
seebaermichi:a2-v8-node-matrix

Conversation

@seebaermichi

Copy link
Copy Markdown

yarn test on master fails 2 of 650 tests on Node 20, 22 and 24. Both failures are in packages/pug/test/error.reporting.test.js (the "runtime errors › in a mixin" and "› in a layout" cases), and both are test-only: Pug reports the filename, line and source context correctly.

Cause. The two assertions pin V8's old TypeError wording, Cannot read property 'length' of null (and … of undefined). Since the Node 16 line, V8 says Cannot read properties of null (reading 'length'). CI never noticed, because both workflows still test on Node 10, 12 and 14 only.

This PR, in two commits:

  1. test(pug): each assertion now accepts the old and the new exact wording, so it still checks what failed (length of null / undefined), on any Node.
  2. ci: the test job in test.yml and rollingversions.yml runs on Node 18.x, 20.x, 22.x and 24.x, and actions/checkout / actions/setup-node move from v2 / v1 to v4 in every job. The publish jobs keep Node 24.x and their registry-url; nothing else changes (steps, permissions, triggers).

Tests, on master c323ed3e:

  • yarn jest packages/pug/test/error.reporting.test.js passes 22/22 with this change on Node 15.14.0 (old wording), 16.20.2, 18.20.8, 20.20.0, 22.22.0 and 24.21.0 (new wording). On master it fails 2/22 on Node 24.21.0.
  • The full yarn test on Node 24: 650/650 pass. Master: 648/650 on Node 20, 22 and 24, the 2 failures being these assertions.
  • prettier --list-different is clean on the changed test file.

The matrix is a proposal. No package declares engines, so I picked 18 through 24, the versions I tested the change on. Happy to change it, for example to keep an older version, add a newer one, or test only the LTS lines in maintenance. This PR's own run is the first test of the new matrix and setup-node@v4; the publish jobs only run on master, so they can't be checked here.

The closed #3461 also relaxed these two assertions, as part of a different fix.

Michael Becker added 2 commits November 10, 2026 16:52
…tions

Node 16+ (V8 9.x) reports "Cannot read properties of null (reading 'length')"
instead of "Cannot read property 'length' of null", so both assertions failed on
every supported Node. Each now accepts the old and the new wording.
Node 10, 12 and 14 are long past end of life. Bump actions/checkout and
actions/setup-node to v4 in every job.
@rollingversions

Copy link
Copy Markdown

There is no change log for this pull request yet.

Create a changelog

@seebaermichi

Copy link
Copy Markdown
Author

Two notes for merging:

  • The branch protection on master requires the checks test (10.x), test (12.x) and test (14.x). This PR renames those jobs to test (18.x) … test (24.x), so the old three will never report. The required checks need updating in the branch protection settings (Settings → Branches) before this can merge.
  • Changelog: none needed. No package's published code changes, only a test file and the CI workflows.

This branch has not been deployed

No deployments
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.

1 participant