Skip to content

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

Merged
juergba merged 1 commit into
masterfrom
juergba/binMocha
Apr 4, 2022
Merged

juergba merged 1 commit into
masterfrom
juergba/binMocha

Conversation

@juergba

@juergba juergba commented Mar 31, 2022 •

Copy link
Copy Markdown
Contributor

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

trusktr commented Sep 17, 2022

Copy link
Copy Markdown

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.

lennonnikolas pushed a commit to lennonnikolas/mocha that referenced this pull request Jan 24, 2026
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