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

Add command line option to turn off the outputReport #114

Closed
gabrielschulhof opened this issue Jun 12, 2019 · 2 comments
Closed

Add command line option to turn off the outputReport #114

gabrielschulhof opened this issue Jun 12, 2019 · 2 comments

Comments

@gabrielschulhof
Copy link

Node.js: 12.4.0
c8: 5.0.1
Platform: Linux eagle 5.1.7-300.fc30.x86_64 #1 SMP Wed Jun 5 12:32:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

My test suite runs child processes and the decision as to whether to run them through c8 is passed along as a command line argument. The child processes output a JSON object which is parsed from their stdout to assert correctness. The unconditional production of c8's outputReport() interferes with the JSON.parse() of the child process' stdout.

Commenting out these lines is a workaround. It'd be nice if they could be turned off with a command line parameter.

@shinnn
Copy link
Contributor

shinnn commented Jun 13, 2019

You can achieve essentially the same thing with the none reporter.

$ c8 node run.js
Hello
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |      100 |      100 |      100 |      100 |                   |
 run.js   |      100 |      100 |      100 |      100 |                   |
----------|----------|----------|----------|----------|-------------------|

$ c8 --reporter=none node run.js
Hello

@gabrielschulhof
Copy link
Author

@shinnn thank you!

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