Skip to content

Conversation

juergba
Copy link
Contributor

@juergba juergba commented Mar 31, 2022

Description

Currently Mocha's executable bin/mocha has no extension. When using Node's --loader (alias: --experimental-loader) option, the process will crash since Node isn't able/willing to handle extensionless entry points:

NODE_OPTIONS="--loader=./lib/loader.mjs" npx mocha

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for .../mocha/bin/mocha

See also extensive discussion in https://github.com/nodejs/node/discussions/41711.

Description of the Change

Rename bin/mocha to bin/mocha.js.

Applicable issues

related #4645 and #4720

@juergba juergba self-assigned this Mar 31, 2022
@juergba juergba added semver-major implementation requires increase of "major" version number; "breaking changes" type: cleanup a refactor area: node.js command-line-or-Node.js-specific labels Mar 31, 2022
@juergba juergba added this to the v10.0.0 milestone Mar 31, 2022
@juergba juergba marked this pull request as ready for review April 3, 2022 06:21
@juergba juergba requested a review from a team April 3, 2022 06:22
@trusktr
Copy link

trusktr commented Sep 17, 2022

I don't know if it was true back in March, but we can point the bin field to mocha.js and keep the mocha name for the executable command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: node.js command-line-or-Node.js-specific semver-major implementation requires increase of "major" version number; "breaking changes" type: cleanup a refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants