Skip to content

Make tests use a dynamic / non-hardcoded (outdated) version(s) of Node#1534

Merged
JackPGreen merged 3 commits intomasterfrom
dynamic-node-support
Apr 28, 2025
Merged

Make tests use a dynamic / non-hardcoded (outdated) version(s) of Node#1534
JackPGreen merged 3 commits intomasterfrom
dynamic-node-support

Conversation

@JackPGreen
Copy link
Copy Markdown
Contributor

The build fails on Node 10:

/home/runner/work/hazelcast-nodejs-client/hazelcast-nodejs-client/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:2059
                                    if (options.signal?.aborted && !hasThrown) {

In #1321 the tests were updated to:

Run nightlies in Node 10 and 18 which are the oldest supported and newest Node versions

(except for code_quality.yml, which was left on 12)

However, the version of sinonjs/fake-timers we use (dependency of nise which is a dependency of sinon) uses optional chaining syntax, requiring Node >=14.

Instead of hardcoding Node version(s), we can take the original logic (newest/oldest supported versions) and compute that dynamically instead based on the NodeJS release metadata.

The net result of this change is that (today), tests that run on a range of versions will run on 18 & 22, with tests on a specific version using 22.

Example execution showing it now successfully compiles with the dynamic versions (other test failures out of scope).

@JackPGreen JackPGreen self-assigned this Apr 17, 2025
@JackPGreen JackPGreen enabled auto-merge (squash) April 17, 2025 09:58
@JackPGreen JackPGreen disabled auto-merge April 28, 2025 09:12
@JackPGreen JackPGreen merged commit 73250c1 into master Apr 28, 2025
9 of 18 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