-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Html report broken #215
Comments
Okay, my problem is that I'm transpiling and bundling my sources before running the tests, instead of letting ava transpile my sources. |
Your best bet is to transpile with source-maps (either embedded our external If you don't want to deploy source-maps, transpile to |
Closing. Feel free to open another issue if you think there's something |
This is what I ended up with: "babel": {
"presets": [
"es2015",
"stage-0"
]
},
"ava": {
"babel": "inherit",
"files": [
"test/**/*.js"
],
"source": [
"src/**/*.js"
],
"require": [
"babel-register"
]
}, Which now gives me coverage reporting for individual source files. However, at the very first occurence of a "not covered branch" in the html report, the css paints the entire rest of the page yellow. |
Try adding |
Didn't make a difference. If I inspect the html, the first occurrence of a "not covered branch" starts with: <span class="branch-1 cbranch-no" title="branch not covered"> Instead of that |
Hmm. That almost seems like an istanbul issue. I'm not sure how our source-map remapping could impact that. |
I guess it's not a big deal, it just forces me to add coverage from the top of the file on down. |
It should be fixed. Either in istanbul or here. |
@jmdobry - Can you create a minimal reproduction on GItHub that @novemberborn and I can clone and play with. |
There may already be an open issue: gotwarlost/istanbul#557 |
@jmdobry give this a spin: we've released better support for ES6/ES7 coverage using the coverage instrumentation library. |
I'll give it a try |
nyc appears to correctly report code coverage when it prints to the console:
But when I then run
nyc report --reporter=html
the generated html report is useless:The code in that image is executed hundreds of times during the tests, but the html report shows nothing.
I feel like I'm missing something, perhaps related to source maps. You can see that the source file under test is
dist/js-data.js
.dist/js-data.js.map
is available, but the source map seems to be ignored, as nyc doesn't split the report up for the individual files that were bundled intodist/js-data.js
.Steps to reproduce:
git clone https://github.com/js-data/js-data.git
cd js-data
git checkout v3
npm install
npm test
npm run html-report
open coverage/index.html
Thanks for any help. I'd love to get coverage reporting for the individual source files, in addition to an html report that tells me which lines I still need to cover.
The text was updated successfully, but these errors were encountered: