简体   繁体   中英

Jenkins/SonarQube unit testing code coverage for JavaScript

We set up Jenkins/SonarQube to fail a build if a developer commits new code that has less than 70% of unit testing code coverage for Java. We would love to do the same for JavaScript. This turned out to be problematic.

To get SonarQube to analyze JavaScript unit tests you have to use an option like this (taken from Jenkins context):

sonar.javascript.jstestdriver.reportsPath=${WORKSPACE}/my-project/generated-reports/jstd

The problem is that using JSTestDriver ( https://code.google.com/p/js-test-driver/ ) is out of the question because it's old and not compatible with modern JavaScript frameworks like AngularJS or ReactJS.

Question: has anybody encountered and solved this problem?

JavaScript支持LCOV

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM