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

karma-sonarqube-reporter

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-sonarqube-reporter - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.coveralls.yml

2

lib/report-builder.js

@@ -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

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