Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename 'bin/mocha' to 'bin/mocha.js' #4863

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Rename 'bin/mocha' to 'bin/mocha.js' #4863

merged 1 commit into from
Apr 4, 2022

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 nodejs/node#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.

This was referenced Jul 31, 2024
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