-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
duplicatebeen there, done that, got the t-shirt...been there, done that, got the t-shirt...type: featureenhancement proposalenhancement proposal
Description
Hi mocha team!
Using the --experimental-loader
node flag with mocha bin will cause it to crash because it has no extension.
Example:
NODE_OPTIONS="--experimental-loader=./lib/loader.mjs" npx mocha
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for .../mocha/bin/mocha
Explanation:
More specifically, the --experimental-loader
flag will cause node to pick the esm loader to load bin/mocha
and it does not like file without extensions (unlike the cjs loader).
Solution:
Add ".js" extension to bin/mocha
which would still allow to create a symbolic link at .bin/mocha
without file extension.
Metadata
Metadata
Assignees
Labels
duplicatebeen there, done that, got the t-shirt...been there, done that, got the t-shirt...type: featureenhancement proposalenhancement proposal