-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project-local custom reporters #2434
Comments
@cletusw Sounds about right. Just nest another try/catch with |
Will do. |
@boneskull On a related note, what's the difference between that code in Lines 209 to 220 in 2a51080
|
That code is causing errors after my fix, but it looks like |
Closes mochajs#2434 Previously, mocha --reporter=./path/to/custom-reporter.js would fail. Also removes code from _mocha that has been unnecessary since 191b88c
Closes mochajs#2434 Previously, mocha --reporter=./path/to/custom-reporter.js would fail. Also removes code from _mocha that has been unnecessary since 191b88c
Closes mochajs#2434 Previously, mocha --reporter=./path/to/custom-reporter.js would fail. Also removes code from _mocha that has been unnecessary since 191b88c
This feature has been released in v3.3.0! 🎉 |
I can't get this to work with v4.0.1. |
Try removing any leading |
According to the wiki, you can
The second part ("reporters that are npm modules") works fine, but when I try to use a project-local custom reporter, I'm forced to specify the path relative to
node_modules/mocha/lib/
.That is, supposing I have a
custom-reporter.js
in the root of my project, runningfails, but
works.
It would instead be nice if the
--reporter
option were relative to the current directory for non-npm reporters.Here's the relevant line that needs fixing. It would need to fall back to something like
path.resolve(process.cwd(), reporter)
. I can try to put together a PR, but I want to make sure I'm not missing something.The text was updated successfully, but these errors were encountered: