-
Notifications
You must be signed in to change notification settings - Fork 785
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
Error on html report generation #94
Comments
Only the HTML report uses the actual sources of your files for annotating the uncovered lines and branches. If for any reason your source files have changed between the time they were instrumented and the reporting, you will see this error. So, is it possible that your source files may have changed in the interim? |
It's absolutely impossible. I have a grunt build workflow which :
grunt.file.write(filepath, instrumenter.instrumentSync(String(fs.readFileSync(filepath)), filepath));
I added some logging into report/html.js:
So structuredText array really doesn't contain values from lineStats. |
Thanks for the details. I think I know what is happening. Basically structured text contains the source code of the instrumented file and not the original source code. It needs the original source code. The fix is to not instrument files in place. Structure your grunt task so that the file is instrumented from the original path and written to the tmp/ directory. That way the instrumented file in the tmp/ directory correctly refers to the original source code. As it stands now, it is referring to the same file which now contains the instrumented code. |
@gotwarlost Thanks a lot. I've done as you described and everything works fine. Cool. Is it possible to flatten files in html report? |
No, not right now. The HTML report was designed to be 100% compatible with the That said people have asked for different things:
These are good requirements and will need changes to the html report to support additional flags. I'll see what I can do once I get some time to work on this. |
Thanks. I'm looking forward for the lib progress, it's awesome! btw: I published my grunt taks in grunt-croc-qunit plugin (I know it's a yet another grunt plugin for Istanbul/qunit/phantomjs but anyway) |
I also had that error. However, I was using the hbsfy transform for browserify at that time, ignoring the templates folder fixed that issue as well. |
Using mochify-istanbul, I found that anything that I was using transform for would mess up the source mapping. Adding |
I have a coverage.json file with coverage info extracted from within browser after qunit tests completed (as value of window.coverage). No I'm trying to generate a html report:
Then I execute:
and get the following error:
"text" report generation works.
The text was updated successfully, but these errors were encountered: