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

Read merged coverage as CLI text output #1001

Closed
wyqydsyq opened this issue Feb 25, 2019 · 2 comments
Closed

Read merged coverage as CLI text output #1001

wyqydsyq opened this issue Feb 25, 2019 · 2 comments
Labels

Comments

@wyqydsyq
Copy link

I'm currently using the nyc merge command to merge the coverage of my unit tests and integration tests which run separately, the resulting JSON and HTML report files are correctly merged, but I would also like to get the text summary of the merged results displayed on the CLI

There needs to be an option on the merge command to tell nyc to also display the text report of the merged results

@wyqydsyq wyqydsyq changed the title Read merged coverage Read merged coverage as CLI text output Feb 25, 2019
@thePunderWoman
Copy link

thePunderWoman commented Feb 27, 2019

The way I've been solving this is actually to not use the nyc merge command and instead run sequential test runs with the --no-clean flag. When you run nyc report at the end of all that, you get a nice, combined html report with all the runs together. Example:

package.json scripts:

    "cover": "npm run cover:unit && npm run cover:integration && npm run cover:report",
    "cover:unit": "nyc --silent mocha",
    "cover:integration": "nyc --silent --no-clean mocha \"test-integration/**/*.ts\"",
    "cover:report": "nyc report --reporter=lcov --reporter=html --reporter=text",

The first unit test run doesn't have the --no-clean flag. So it wipes the .nyc_output directory before starting. The integration test has the flag and just appends to the folder. The report then combines all of it.

@JaKXz JaKXz added the doc label Feb 27, 2019
@stale stale bot added the stale label Apr 28, 2019
@istanbuljs istanbuljs deleted a comment from stale bot May 4, 2019
@stale stale bot removed the stale label May 4, 2019
@JaKXz
Copy link
Member

JaKXz commented May 4, 2019

#1093 put @janiukjf's suggestion on the readme so I'm closing this for now.

@JaKXz JaKXz closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants