-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
area: node.jscommand-line-or-Node.js-specificcommand-line-or-Node.js-specifictype: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Milestone
Description
Prerequisites
- Checked that your issue hasn't already been filed by cross-referencing issues with the
faqlabel - Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
- 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
- Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
node node_modules/.bin/mocha --version(Local) andmocha --version(Global). We recommend avoiding the use of globally installed Mocha.
Description
When executing mocha with the option --require trace-something, the error bad-option --trace-something is output. In my case. it is trace-and-clarify-if-possible, but it is reproducible with other package names.
This happens in [email protected] and [email protected], but not in [email protected], and only if the required package-name starts with "trace-"
Steps to Reproduce
# Setup dependency with empty index.js-file
mkdir trace-dependency
cd trace-dependency/
npm init -y
touch index.js
cd ..
# Setup project and add dependency
mkdir test-project
cd test-project
npm init -y
npm install ../trace-dependency
mkdir test
touch test/dash-spec.js
Then install mocha and run the tests:
npm install [email protected]
npx mocha --require trace-dependency
# Error "bad option --trace-dependency"
npm install [email protected]
npx mocha --require trace-dependency
# Error "bad option --trace-dependency"
npm install [email protected]
npx mocha --require trace-dependency
# No error, "0 passing"
Expected behavior: [What you expect to happen]
I would have expected the same result for each mocha-version, i.e. the output "0 passing".
Actual behavior: [What actually happens]
[email protected]and[email protected]have the output "bad option --trace-dependency"[email protected]has the expected output
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Versions
- The output of
mocha --versionandnode node_modules/.bin/mocha --version: 6.0.0, 6.0.1 - The output of
node --version: v10.15.1 - The version and architecture of your operating system: Xubuntu 18.04
- Your shell (bash, zsh, PowerShell, cmd, etc.): bash
- Any other third party Mocha related modules (with versions): none
- The code transpiler being used: none
Additional Information
Metadata
Metadata
Assignees
Labels
area: node.jscommand-line-or-Node.js-specificcommand-line-or-Node.js-specifictype: buga defect, confirmed by a maintainera defect, confirmed by a maintainer