@@ -21,7 +21,7 @@ const exec = util.promisify(require('child_process').exec)
21
21
test ( 'should gracefully handle ESM imports' , async ( t ) => {
22
22
await t . test ( 'when requiring newrelic.js in ESM app' , async ( ) => {
23
23
const { stdout, stderr } = await exec ( 'node index.mjs' , { cwd : path . join ( __dirname , 'esm-js' ) } )
24
- if ( semver . gte ( process . version , '22.12.0' ) ) {
24
+ if ( semver . satisfies ( process . version , '>=20.19.0 <22 || >= 22.12.0' ) ) {
25
25
match ( stdout , 'Hello esm-test' )
26
26
} else {
27
27
match ( stderr , 'ERR_REQUIRE_ESM' , 'should mention ERR_REQUIRE_ESM in error message' )
@@ -30,7 +30,7 @@ test('should gracefully handle ESM imports', async (t) => {
30
30
31
31
await t . test ( 'when requiring newrelic.mjs in ESM app' , async ( ) => {
32
32
const { stdout, stderr } = await exec ( 'node index.mjs' , { cwd : path . join ( __dirname , 'esm-mjs' ) } )
33
- if ( semver . gte ( process . version , '22.12.0' ) ) {
33
+ if ( semver . satisfies ( process . version , '>=20.19.0 <22 || >= 22.12.0' ) ) {
34
34
match ( stdout , 'Hello esm-test' )
35
35
} else {
36
36
match ( stderr , 'ERR_REQUIRE_ESM' , 'should mention ERR_REQUIRE_ESM in error message' )
0 commit comments