Skip to content

Commit

Permalink
import executables also work on Node.js v20.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bengl committed Nov 30, 2023
1 parent f935c89 commit e4257ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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.x, 21.x]
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]

steps:
Expand Down
8 changes: 5 additions & 3 deletions test/other/import-executable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

import { rejects } from 'assert'
(async () => {
const [processMajor] = process.versions.node.split('.').map(Number)
if (processMajor >= 21) {
// Files without extension are supported in Node.js 21+
const [processMajor, processMinor] = process.versions.node.split('.').map(Number)
const extensionlessSupported = processMajor >= 21 ||
(processMajor === 20 && processMinor >= 10)
if (extensionlessSupported) {
// Files without extension are supported in Node.js >= 20.10.0
return
}
await rejects(() => import('./executable'), {
Expand Down

0 comments on commit e4257ba

Please sign in to comment.