karma-sonarqube-reporter
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
// report.ts | ||
// report-builder.ts | ||
function createReport() { | ||
@@ -3,0 +3,0 @@ return { |
{ | ||
"name": "karma-sonarqube-reporter", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A karma reporter plugin which generates unit test reports for sonarqube.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "nyc jasmine && nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
@@ -28,3 +28,10 @@ "repository": { | ||
"clone-regexp": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.0", | ||
"jasmine": "^3.1.0", | ||
"jasmine-spec-reporter": "^4.2.1", | ||
"mock-require": "^3.0.2", | ||
"nyc": "^11.6.0" | ||
} | ||
} |
# karma-sonarqube-reporter | ||
A [Karma][1] reporter plugin for generating [SonarQube][2] generic test execution data. | ||
A [Karma][1] reporter plugin for generating [SonarQube][2] generic test execution data. | ||
[![Build Status](https://travis-ci.org/fadc80/karma-sonarqube-reporter.svg?branch=master)](https://travis-ci.org/fadc80/karma-sonarqube-reporter) | ||
[![Coverage Status](https://coveralls.io/repos/github/fadc80/karma-sonarqube-reporter/badge.svg?branch=master)](https://coveralls.io/github/fadc80/karma-sonarqube-reporter?branch=master) | ||
## Installation | ||
@@ -14,3 +17,3 @@ | ||
1. Create new plugin entry | ||
**Create a new plugin entry** | ||
@@ -23,3 +26,3 @@ ```typescript | ||
2. Add a configuration object | ||
**Add configuration parameters** | ||
@@ -35,3 +38,3 @@ ```typescript | ||
3. Enable it | ||
**Enable the `sonarqube` reporter** | ||
@@ -42,48 +45,8 @@ ```typescript | ||
See below a `karma.conf.js` full example: | ||
Check a [karma.conf.js][3] full example | ||
```typescript | ||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular/cli'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-firefox-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('karma-sonarqube-reporter'), | ||
require('@angular/cli/plugins/karma') | ||
], | ||
client:{ | ||
clearContext: false | ||
}, | ||
coverageIstanbulReporter: { | ||
reports: [ 'html', 'lcovonly' ], | ||
fixWebpackSourcePaths: true | ||
}, | ||
sonarqubeReporter: { | ||
basePath: 'src/app', | ||
outputFolder: 'reports', | ||
filePattern: '**/*spec.ts', | ||
encoding: 'utf-8' | ||
}, | ||
angularCli: { | ||
environment: 'dev' | ||
}, | ||
reporters: ['progress', 'kjhtml', 'sonarqube'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome', 'Firefox'], | ||
singleRun: false | ||
}); | ||
}; | ||
``` | ||
## Running | ||
If your project uses [Angular CLI][3] run `ng test` and check the output folder. | ||
If your project uses [Angular CLI][4] run `ng test` and check the output folder. | ||
@@ -96,5 +59,5 @@ ```command | ||
The report files' schema is defined on the [SonarQube Generic Test Data][4] page. | ||
The report files' schema is defined on the [SonarQube Generic Test Data][5] page. | ||
Now add the following property to your `sonar-project.properties`: | ||
Add the following property to your `sonar-project.properties`: | ||
@@ -107,3 +70,3 @@ ``` | ||
Finally, start [SonarQube Scanner][5] on your project folder. | ||
Finally, start [SonarQube Scanner][6] on your project folder. | ||
@@ -114,4 +77,5 @@ That's all! | ||
[2]: https://www.sonarqube.org/ | ||
[3]: https://github.com/angular/angular-cli | ||
[4]: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data#GenericTestData-GenericExecution | ||
[5]: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner | ||
[3]: https://github.com/fadc80/karma-sonarqube-reporter/blob/master/karma.conf.js | ||
[4]: https://github.com/angular/angular-cli | ||
[5]: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data#GenericTestData-GenericExecution | ||
[6]: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
15878
14
377
0
5
75