You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mocha looks for mocha.opts in test/mocha.opts. Ref: #1275 (comment)
Many projects keep tests next to the code they're testing, which means there's no test/ directory and so unless that test/ folder is created especially for this config file, there's no place that mocha.opts will be read by default.
#1277 provides an alternative here. You can put mocha.opts wherever you want, e.g. alongside package.json, and specify --opts mocha.opts. However the package.json I'm working with has 11 different mocha invocations. I can add --opts mocha.opts to each one, though it's inconvenient and makes these invocations more difficult to read.
It would be a usability improvement to default to searching for mocha.optsalongside the package.json in addition to looking in test/mocha.opts.
Steps to Reproduce
Set options in mocha.opts alongside package.json e.g. --reporter mocha-env-reporter
Run mocha
Expected behavior: The reporter is loaded.
Actual behavior: The reporter is not loaded.
Reproduces how often: Always.
Additional Information
If both files exist, probably it makes sense to print a warning and use test/mocha.opts, for compatibility with the old behavior.
The text was updated successfully, but these errors were encountered:
I think its very close to being released. We usually send messages out to usual channels (Twitter/Gitter etc) but you could track via a Github "Releases only" notification.
Hope that helps.
Prerequisites
faq
labelDescription
Mocha looks for
mocha.opts
intest/mocha.opts
. Ref: #1275 (comment)Many projects keep tests next to the code they're testing, which means there's no
test/
directory and so unless thattest/
folder is created especially for this config file, there's no place thatmocha.opts
will be read by default.#1277 provides an alternative here. You can put
mocha.opts
wherever you want, e.g. alongsidepackage.json
, and specify--opts mocha.opts
. However thepackage.json
I'm working with has 11 differentmocha
invocations. I can add--opts mocha.opts
to each one, though it's inconvenient and makes these invocations more difficult to read.It would be a usability improvement to default to searching for
mocha.opts
alongside thepackage.json
in addition to looking intest/mocha.opts
.Steps to Reproduce
mocha.opts
alongsidepackage.json
e.g.--reporter mocha-env-reporter
mocha
Expected behavior: The reporter is loaded.
Actual behavior: The reporter is not loaded.
Reproduces how often: Always.
Additional Information
If both files exist, probably it makes sense to print a warning and use
test/mocha.opts
, for compatibility with the old behavior.The text was updated successfully, but these errors were encountered: