Introduction
This is a mocha reporter project to integrate mocha unit tests to sonar Generic Test coverage unit tests execution results
It is a fork of mocha-sonar-generic-test-coverage that adds support for using the reporter alongside others with mocha-multi-reporters
This reporter is only for unit test success/failures verification, to unit test line coverage take a look on istanbul reporter
Installation
npm install mocha-sonar-generic-reporter --save-dev
On pure mocha
mocha --reporter mocha-sonar-generic-reporter testFolder
On mocha-test for use with grunt
mochaTest: coverage: options: reporter: 'mocha-sonar-generic-reporter' quiet: false captureFile: null // default mocha test capture file variable reporterOptions: outputFile: null // relative path file to capture instead append to captureFile (this file will not get prints at stdout) useFileFullPath: false // generate report for the files using fullpath src: 'test.js' }
Testing
$ npm install && npm test
Report demo sample
$ npm install && \
cd demo && \
npm install && \
npm start
Output example
long stacktrace long stacktrace long stacktrace