Skip to content
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

Incompatible with unpublished thrid-party reporter #58

Closed
ouchxp opened this issue Oct 20, 2016 · 3 comments
Closed

Incompatible with unpublished thrid-party reporter #58

ouchxp opened this issue Oct 20, 2016 · 3 comments

Comments

@ouchxp
Copy link

ouchxp commented Oct 20, 2016

I have a third-party mocha reporter would like to use, but checkReporter does not allow that.
In checkReporter we have two checks, require("mocha/lib/reporters/" + reporter); and require(reporter); which applies to mocha's built-in reporter and published reporter. However unpublished reporter in my project will always fail.

Error: reporter "test/test-lib/specReporterWithLineNumber" does not exist
...

I think an extra require("mocha/../../" + reporter); to check against unpublished thrid-party reporter would be nice to have. It's a bad pattern though. Currently I have to use NODE_PATH=. to solve this issue, which is not ideal either.

@zinserjan
Copy link
Owner

Mocha doesn't support this at the moment.

@ouchxp
Copy link
Author

ouchxp commented Oct 31, 2016

@zinserjan What is mocha not supporting? I'm currently using third-party reporter I wrote, and it works fine.
I put the reporter at test/test-lib/specReporterWithLineNumber.js and executing it with script like this NODE_PATH=test/test-lib mocha-webpack --webpack-config webpack.config.test.js --reporter specReporterWithLineNumber ...

@zinserjan
Copy link
Owner

Fixed by #87.

Node_PATH hack is no longer necessary. The following works:

mocha-webpack --webpack-config webpack.config.test.js --reporter test/test-lib/specReporterWithLineNumber.js ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants