diff --git a/test/hook/v18-static-import-assert.mjs b/test/hook/v18-v21-static-import-assert.mjs similarity index 100% rename from test/hook/v18-static-import-assert.mjs rename to test/hook/v18-v21-static-import-assert.mjs diff --git a/test/version-check.js b/test/version-check.js index fc3341a..fdc2f5c 100644 --- a/test/version-check.js +++ b/test/version-check.js @@ -12,10 +12,11 @@ process.env.IITM_TEST_FILE = filename const [processMajor, processMinor] = process.versions.node.split('.').map(Number) -const match = filename.match(/v([0-9]+)(?:\.([0-9]+))?/) +const match = filename.match(/v([0-9]+)(?:\.([0-9]+))?(?:-v([0-9]+))?/) const majorRequirement = match ? match[1] : 0 const minorRequirement = match && match[2] +const majorMax = match ? match[3] : Infinity if (processMajor < majorRequirement) { console.log(`skipping ${filename} as this is Node.js v${processMajor} and test wants v${majorRequirement}`) @@ -25,3 +26,8 @@ if (processMajor <= majorRequirement && processMinor < minorRequirement) { console.log(`skipping ${filename} as this is Node.js v${processMajor}.${processMinor} and test wants >=v${majorRequirement}.${minorRequirement}`) process.exit(0) } + +if (processMajor > majorMax) { + console.log(`skipping ${filename} as this is Node.js v${processMajor} and test wants <=v${majorMax}`) + process.exit(0) +}