0.2.9 • Published 7 years ago

sonar-js-coverage-convertor v0.2.9

Weekly downloads
52
License
MIT
Repository
github
Last release
7 years ago

sonar-js-coverage-convertor

Because Sonarqube is unable to generate coverage for Javascript applications, this module will convert Istanbul reports to a generic format which Sonarqube can interpret. Convert Istanbul clover coverage reports to SonarQube Generic Data format for Polymer app usage.

Usage

If you have multiple coverage files which you need to merge, do so prior to running the convertor. See Merge Module for details.

From npm run scripts

{
	"…": "…",
	"presonarCoverage": "wct",
	"sonarCoverage": "istanbul-merge coverage-server/coverage-final.json coverage-client/coverage-final.json",
	"postsonarCoverage": "sonar-generic-coverage-convertor",
	"…": "…"
}

npm run sonarCoverage

Example wct.conf.json

{
	"plugins": {
		"istanbul": {
			"dir": "./coverage-client",
			"reporters": ["lcov", "clover", "json"],
			"include": [
				"**/spec*.html",
				"**/spec*.js"
			],
			"exclude": [
				"**/polymer/polymer.js",
				"**/platform/platform.js",
				"**/bower_components/**",
				"**/node_modules/**"
			],
			"thresholds": {
				"global": {
					"statements": 90
				}
			}
		}
	}
}

Example mocha

Generate server-side coverage reports
nyc --report-dir ./coverage-server --reporter lcov --reporter json --reporter clover mocha server/**/*.spec.js

Merge Module

This module is used to merge multiple coverage reports prior to converting the single resulting report to Sonarqube's generic coverage format.

COVERAGE_DIR=coverage istanbul-merge coverageDir1/coverage-final.json coverageDir2/coverage-final.json
COVERAGE_DIR=outDir istanbul-merge dir1/in.json dir2/in.json
istanbul-merge dir1/in.json dir2/in.json

Dev

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago