Enabling nyc to generate reports from coverage.raw.json
See original GitHub issueHi, I’d like to make a feature request.
If nyc
can generate reports by only reading coverage.json, then it’d be convenient.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to generate nyc report from json results (no . ...
It grabs the JSON files from the coverage directory and puts them altogether into an HTML report in the coverage/summary subdirectory.
Read more >nyc - npm
Follow their documentation to enable and configure coverage reporting. Configuring nyc. nyc accepts a wide variety of configuration arguments, ...
Read more >nyc/README.md
Coverage Status](https://coveralls.io/repos/bcoe/nyc/badge.svg?branch=)]( ... 107, 2. disable nyc's instrumentation and source-maps, e.g. in `package.json`:.
Read more >Generate report from __coverage__ object
Output the contents of window.__coverage__ (assuming it's in Istanbul 1.0 format) to .nyc_output/out.json . To generate HTML report for example, run:
Read more >cypress/code-coverage - npm Package Health Analysis
You can specify custom report folder by adding nyc object to the package.json file. For example to save reports to cypress-coverage folder, use:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After trying multiple nyc commands to produce the report from JSON with no luck, I found an interesting behavior of nyc: You have to be in the parent directory of the instrumented code when you are generating a report. For example: If the code I instrumented is in
/usr/share/node/**
, and the mergedcoverage.json
result is in/tmp
directory. If I runnyc report --temp-dir=/tmp --reporter=text
under/tmp
, I won’t get anything.But if I run the same command under
/usr/share/node
or/
, I’m able to get the correct output with coverage numbers. Not sure if it’s a weird permission issue in nyc.@coreyfarrell I just read
nyc
’s docs first time a few days ago. To me, it was unclear thatnyc
can generate reports from coverage.json.For more reader-friendly docs(and for folks who do not know
.nyc_output
), how do you think an explicit mention on this feature with practical command usage example (like below)?