-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use file instead of stdout #16
Comments
Thank you for the issue, @honzajavorek . If I remember correctly, an issue requesting support for running multiple reporters at the same time was opened before, but I can't seem to find it. As far as I know, mocha doesn't provide any means to use multiple reporters at the same time. However, a quick Google given reporters such as mocha-multi-reporters. A composite reporter is a great idea, either your own or one pre-existing. As soon as I have the time I'll make the reporter either monkey-patchable, by using a separate function to write output, and/or make it configurable to write to a file or stdout. |
@honzajavorek Only made it monkey-patchable for now. Can you verify this fits your needs? |
@StevenLooman You are correct Mocha doesn't really support multiple reporters (yet or very well, considering my approach to be rather workaround). The changes you made in fe526ff are exactly what I need. It's really great. This way I'll just override the |
@honzajavorek Great. I have just release version |
Thank you! 🎉 |
Currently, I first run my tests with regular reporter and then I instrument the codebase and run the test suite again, with
mocha-lcov-reporter
. That works, but takes twice as much time then running the tests in a regular way.Also, some CIs (e.g. Travis CI) kill the build if there's no output for certain time, so if I redirect the stdout of
mocha-lcov-reporter
to a file by>
as advised in README, the instrumented run gets killed - it doesn't output anything to stdout for a long time and CI sees it as a stale process.Thus I'd like to use
mocha-lcov-reporter
combined together with other Mocha reporters. It's possible by creating filereporter.coffee
like this (CoffeeScript, but JS would work as well):...and then running Mocha with
--reporter=test/reporter.coffee
. But in this case, I need to separate lcov output and regular spec reporter output, both will get combined on stdout. I need to configuremocha-lcov-reporter
to internally append the lcov results to a given file, instead of stdout.I looked into the code of your lcov reporter and there seems to be no easy way not only configure the reporter, but even monkey-patching isn't possible, as all the important functionality happens in externally inaccessible functions.
@StevenLooman What do you think about this feature? How would you approach implementing it? I'm willing to contribute it, if you give me some pointers.
The text was updated successfully, but these errors were encountered: