Skip to content

Commit 1e05e4b

Browse files
authored
test: skip static-import on > v21 (#81)
Better fix for #80 Closes #73
1 parent 00b01ff commit 1e05e4b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/version-check.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ process.env.IITM_TEST_FILE = filename
1212

1313
const [processMajor, processMinor] = process.versions.node.split('.').map(Number)
1414

15-
const match = filename.match(/v([0-9]+)(?:\.([0-9]+))?/)
15+
const match = filename.match(/v([0-9]+)(?:\.([0-9]+))?(?:-v([0-9]+))?/)
1616

1717
const majorRequirement = match ? match[1] : 0
1818
const minorRequirement = match && match[2]
19+
const majorMax = match ? match[3] : Infinity
1920

2021
if (processMajor < majorRequirement) {
2122
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) {
2526
console.log(`skipping ${filename} as this is Node.js v${processMajor}.${processMinor} and test wants >=v${majorRequirement}.${minorRequirement}`)
2627
process.exit(0)
2728
}
29+
30+
if (processMajor > majorMax) {
31+
console.log(`skipping ${filename} as this is Node.js v${processMajor} and test wants <=v${majorMax}`)
32+
process.exit(0)
33+
}

0 commit comments

Comments
 (0)