You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTML report where you can click on files to see their code coverage.
Observed Behavior
HTML report which is broken for some of the files:
TypeError: Cannot read property 'locations' of undefined
Scenario
I wrote TypeScript code which behaves differently depending on the environment (Node.js or a HTML5 browser) it runs on.
To test every part of my code, I need to run tests in a Browser environment and in a Node.js environment.
For running tests in Node.js, I am using nyc in combination with jasmine and ts-node/register.
Browser tests are performed by karma with karma-jasmine and karma-chrome-launcher.
When I execute the browser tests in my project (yarn test:browser), I am getting HTML output (coverage/browser/html) and JSON output (coverage/json/coverage-browser.json). The HTML report works fine. I can see my TypeScript files in the report and their coverage.
When I execute the Node.js tests in my project (yarn test:node), I am also getting HTML output (coverage/node/html) and JSON output (coverage/json/coverage-final.json). The HTML report looks fine here too!
The code coverage of my browser tests report that half of my code is covered by tests.
The code coverage of my Node.js tests report that the other half of my code is covered.
I would like to join both code coverage reports now to receive one universal (merged) report that states that my app code is fully covered by tests.
I have read documentation on nyc merge and thought it is a good idea to run nyc report (which implicitly merges coverage information) and point it to my JSON output files:
The nyc report command finishes and I am receiving an HTML report but the report is broken (see "Observed Behavior"). I would like to know what is going wrong there because when I check the individual HTML reports (coverage/browser/html & coverage/node/html) they look fine.
Forensic Information
Operating System: Windows 10 Pro (but I think the problem is unrelated to the OS) Environment Information:
Node.js v10.9.0
npm v6.4.1
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I do not use karma and have the exact same issue with merging coverage files.
I use cypress and jest and want to merge their coverage outputs.
What happens is exactly what was described by @bennyn.
Link to bug demonstration repository.
Expected Behavior
HTML report where you can click on files to see their code coverage.
Observed Behavior
HTML report which is broken for some of the files:
Scenario
nyc
in combination withjasmine
andts-node/register
.karma
withkarma-jasmine
andkarma-chrome-launcher
.yarn test:browser
), I am getting HTML output (coverage/browser/html
) and JSON output (coverage/json/coverage-browser.json
). The HTML report works fine. I can see my TypeScript files in the report and their coverage.yarn test:node
), I am also getting HTML output (coverage/node/html
) and JSON output (coverage/json/coverage-final.json
). The HTML report looks fine here too!I would like to join both code coverage reports now to receive one universal (merged) report that states that my app code is fully covered by tests.
I have read documentation on nyc merge and thought it is a good idea to run
nyc report
(which implicitly merges coverage information) and point it to my JSON output files:The
nyc report
command finishes and I am receiving an HTML report but the report is broken (see "Observed Behavior"). I would like to know what is going wrong there because when I check the individual HTML reports (coverage/browser/html
&coverage/node/html
) they look fine.Forensic Information
Operating System: Windows 10 Pro (but I think the problem is unrelated to the OS)
Environment Information:
The text was updated successfully, but these errors were encountered: