Regression: Mocha ignores files after --
(end of CLI options)
#3899
Labels
area: node.js
command-line-or-Node.js-specific
status: needs upstream fix
defect within Mocha's dependency tree
type: bug
a defect, confirmed by a maintainer
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
During the Mocha@6 rewrite of the CLI, a regression occurred: Mocha now ignores the test files supplied after
--
. Support for--
is required to allow consumers to safely generate the command line arguments and avoid conflicts between test files and CLI options.Steps to Reproduce
In a directory with
test.spec.js
, run:Expected behavior: Mocha executes the tests in
test.spec.js
.Actual behavior: Mocha immediately returns with the following error:
Reproduces how often: All the time
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 6.1.4node --version
: 12.1.0Additional Information
In Mocha@5, the command
mocha -- test.spec.js
works. It fails since the rewrite from #3556.The text was updated successfully, but these errors were encountered: