Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JackPGreen
Copy link
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
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