Skip to content

Conversation

@kirrg001
Copy link
Contributor

@kirrg001 kirrg001 commented Dec 4, 2025

No description provided.

@kirrg001 kirrg001 requested a review from a team as a code owner December 4, 2025 17:46
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

const { retry } = require('../../../../../core/test/test_util');

const mochaSuiteFn =
supportedVersion(process.versions.node) && semver.satisfies(process.versions.node, '18') ? describe : describe.skip;
Copy link
Contributor

@aryamohanan aryamohanan Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
supportedVersion(process.versions.node) && semver.satisfies(process.versions.node, '18') ? describe : describe.skip;
supportedVersion(process.versions.node) && semver.gte(process.versions.node, '18.19.0') ? describe : describe.skip;

This test will fail for the latest v18.x releases because --experimental-loader with esm-loader.mjs is supported only up to Node.js v18.18. From v18.19 onward, the loader mechanism changes and requires using --import together with esm-register.mjs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will just run on < 18.19 then for now 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add --import case soon. I will leave PR open

useGlobalAgent: true,
dirname: __dirname,
enableOtelIntegration: true,
execArgv: ['--experimental-loader', `${rootFolder}/esm-loader.mjs`]
Copy link
Contributor

@aryamohanan aryamohanan Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
execArgv: ['--experimental-loader', `${rootFolder}/esm-loader.mjs`]
execArgv: ['--import', `${rootFolder}/esm-register.mjs`]

I suggest updating the test to target >= v18.19 and use --import together with esm-register.mjs, since this aligns with the supported syntax from that version onward.

The old loader approach is already deprecated in v5 and does not work on above v18.19, so relying on the --import setup is the correct and future-proof option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need both, I had no time to add the other case

Copy link
Contributor

@aryamohanan aryamohanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice to see this test. ❤️

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.

3 participants