Code Coverage on NPM builds

We have been using NPM for build our solution (java) in TFS, and we have integrated SonarQube analysis for the same. But it showing the code coverage as 0%.
Can some one suggest, how to generate code coverage file from our NPM build which will be accessed by SonarQube analysis.
we are successfully running our unit tests in build (using NPM “run test”).


You need to generate a code coverage file using a tool like nyc.

You can get more information about the correct parameters to pass into your analysis once you have your code coverage (lcov) file here: