Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-sonarqube-reporter

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-sonarqube-reporter

mocha reporter for sonar (>6)

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
decreased by-1.95%
Maintainers
2
Weekly downloads
 
Created
Source

mocha-sonarqube-reporter

mocha unit test reporter for sonar (>6.2)

inspired from :

  • qingguo-yu/mocha-sonar-generic-test-coverage-file
  • mageddo/mocha-sonar-generic-test-coverage

According to this page, Sonar (> 6.2) not longer use 'generic test coverage', but 'generic Test Data'. This reporter provides the new compliant XML structure.

Usage

Install and save to your devDependencies

npm install --save-dev mocha-sonarqube-reporter
mocha --reporter mocha-sonarqube-reporter testFolder --reporter-options output=xunit.xml

On mocha-test for use with grunt

mochaTest: {
	sonar: {
		options: {
			reporter: 'mocha-sonarqube-reporter',
			quiet: true,
			reporterOptions:{
			  output : 'unit-tests.xml' // default to ./xunit.xml
			  useFullFilePath: 'true' // default to 'false'. Uses full test file paths in the report.
			}
		},
		src: [
			'app/**/*.spec.js'
		]
	}
}

Output example

<testExecutions version="1">
  <file path="testx/ClassOneTest.xoo">
    <testCase name="test1" duration="5"/>
    <testCase name="test2" duration="500">
      <skipped message="short message">other</skipped>
    </testCase>
    <testCase name="test3" duration="100">
      <failure message="short">stacktrace</failure>
    </testCase>
    <testCase name="test4" duration="500">
      <error message="short">stacktrace</error>
    </testCase>
  </file>
</testExecutions>

LICENSE

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 17 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc