Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

A reporter for Mocha the outputs coverage in as format for general coverage in SonarQube

Notifications You must be signed in to change notification settings

kurtsson/mocha-sonar-xml-cov-reporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mocha reporter for SonarQube General test coverage

This reporter outputs the coverage report using the XML format for the SonarQube General Test Coverage plugin https://docs.sonarqube.org/display/PLUG/Generic+Test+Coverage

https://github.com/visionmedia/mocha/wiki/Third-party-reporters describes using third party reporters in mocha.

Basically, have your project's package.json be like:

{  
  "devDependencies": {  
    "mocha-sonar-xml-cov-reporter": ">=0.0.1"  
  }  
}

Then call mocha with:

mocha --reporter mocha-sonar-xml-reporter test

This also works well with grunt-mocha-test

mochaTest: {  
  test: {  
    // Your test settings  
  },  
  coverage: {  
    options: {  
      reporter: 'mocha-sonar-xml-cov-reporter',  
      quiet: false  
    },  
    src: ['src/files.js']  // Your source code files  
  }  
}

About

A reporter for Mocha the outputs coverage in as format for general coverage in SonarQube

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%