title: Merge coverage for Sonarqube with istabuljs/nyc
body: <p>I have a typescript project that goes through a Jenkins pipeline and does all the functional tests in parallel (after building the main container). At the end of the pipeline - we create code coverage check and then ship the result out to sonarqube.</p>
  
  <p>here is my package.json:</p>
  
  <pre><code>"test": "npm run test:unit &amp;&amp; npm run test:component &amp;&amp; npm run test:functional",
  "test:component": "mocha --reporter mocha-sonarqube-reporter --reporter-options output=tests/coverage/component/test-xcomponent.xml --recursive -r ts-node/register tests/component/*.ts",
  "test:functional": "mocha --reporter mocha-sonarqube-reporter --reporter-options output=tests/coverage/functional/test-xfunctional.xml --recursive -r ts-node/register tests/functional/*.ts",
  "test:unit": "mocha --reporter mocha-sonarqube-reporter --reporter-options output=tests/coverage/unit/test-xunit.xml --recursive -r ts-node/register tests/unit/*.ts",
  "test:unit:nosq": "mocha --recursive -r ts-node/register tests/unit/*.ts",
  "lint": "tslint -t verbose --project tsconfig.json -c tslint.json",
  "cover": "nyc --report-dir tests/coverage/all npm run test",
  "cover:unit": "nyc --report-dir tests/coverage/unit npm run test:unit",
  "cover:functional": "nyc --report-dir tests/coverage/functional -x 'app/repositories' -x 'app/entities' -x 'app/utils' --no-clean npm run test:functional"
  </code></pre>
  
  <p>my sonar-project.properties is like the following:</p>
  
  <pre><code>sonar.exclusions=**/node_modules/**,**/*.spec.ts,app/entities/**,dependency-check-report/*,tests/coverage/**/*
  sonar.tests=tests
  sonar.test.inclusions=tests/**/*
  sonar.ts.tslintconfigpath=tslint.json
  sonar.typescript.lcov.reportPaths=tests/coverage/all/lcov.info
  </code></pre>
  
  <p>I have two problems with this setup:</p>
  
  <ul>
  <li><p>I cannot seem to find a way to merge the different coverage files. I have checked the official istanbuljs/nyc GitHub and it states that it can combine via <code>nyc merge</code> command however the output is .json and sonarqube requires xml. I am stuck with half my code coverage since I'm only shipping out one file out and not the combine file.</p></li>
  <li><p>I currently have code smell errors from the tests/coverage/all folder as it considered missing fonts from the generated coverage is being missing. I have excluded that folder in the <code>sonar-project.properties</code> file and I've included it in the .gitignore too but sonarqube is still reporting it as code small.</p></li>
  </ul>