Skip to content

Commit

Permalink
Extensionless support in 18.19 (#41)
Browse files Browse the repository at this point in the history
Node.js 18.19 backported the extensionless supported added ion Node.js
21.0.0 and 20.10.0, so the test needed to be fixed for that.
  • Loading branch information
bengl authored Dec 1, 2023
1 parent 4ca3824 commit 3cafa99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,25 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.10.0, 16.16.0, 16.17.0, 16.x, 17.x, 18.5.0, 18.x, 20.9.0, 20.x, 21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
node-version:
- 12.x
- 14.x
- 16.10.0
- 16.16.0
- 16.17.0
- 16.x
- 17.x
- 18.5.0
- 18.18.0
- 18.19.0
- 18.x
- 20.9.0
- 20.x
- 21.x
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions test/other/import-executable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { rejects } from 'assert'
(async () => {
const [processMajor, processMinor] = process.versions.node.split('.').map(Number)
const extensionlessSupported = processMajor >= 21 ||
(processMajor === 20 && processMinor >= 10)
(processMajor === 20 && processMinor >= 10) ||
(processMajor === 18 && processMinor >= 19)
if (extensionlessSupported) {
// Files without extension are supported in Node.js >= 20.10.0
// Files without extension are supported in Node.js ^21, ^20.10.0, and ^18.19.0
return
}
await rejects(() => import('./executable'), {
Expand Down

0 comments on commit 3cafa99

Please sign in to comment.