Closed syno2flickr closed 7 years ago
You can do this by instrumenting the JS before you do any JS processing (i.e. aggregation and concatenation, minification).
What is the best mode to get code coverage?
You'll have to use file-mode (which is fine).
Should we use the jscover maven plugin?
No, JSCover JAR is fine.
Thank you for this quick answer.
If we do like you said :
Will we be able to see code coverage on original source files? How does it work?
Will we be able to see code coverage on original source files?
Yes.
How does it work?
Can you be more specific? Read through the documentation and try the examples, and hopefully it will be clear.
It works because JSCover is using file path as array key (_$jscoverage).
Thank you, everything is working fine. I can now see the JS code coverage in Sonar. Great tool, great job, great support, everybody should like JSCover!
Hello,
We would like to add JS code coverage for our project. All tests are using Selenium WebDriver and we're using ExtJS Javascript framework as front-end (Java as back-end). Currently we aggregate all js files in one (app.js) before doing all integration tests. We're using Jacoco for Java code coverage and SonarQube as quality server (Jenkins as CI server, Maven3 for dependencies management). The goal is to see JS code coverage in Sonar per file.
JSCover seems to be the perfect library to get JS code coverage but we have few questions:
Best regards, JB