grunt-karma-sonar
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -0,1 +1,7 @@ | ||
<a name="0.2.7"></a> | ||
# 0.2.7 (2015-06-15) | ||
## Bug Fixes | ||
- Added support excluding any sonar property. | ||
<a name="0.2.6"></a> | ||
@@ -2,0 +8,0 @@ # 0.2.6 (2015-06-09) |
{ | ||
"name": "grunt-karma-sonar", | ||
"description": "Grunt plugin for integrating karma reports with sonar", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"homepage": "https://github.com/mdasberg/grunt-karma-sonar", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -70,2 +70,8 @@ # grunt-karma-sonar [![Build Status](https://travis-ci.org/mdasberg/grunt-karma-sonar.svg?branch=master)](https://travis-ci.org/mdasberg/grunt-karma-sonar) | ||
#### options.excludedProperties | ||
Type: `Array` | ||
Default: [] | ||
Should be a list of sonar properties to exclude | ||
#### options.instance.hostUrl | ||
@@ -72,0 +78,0 @@ Type: `String` |
@@ -16,3 +16,4 @@ 'use strict'; | ||
defaultOutputDir: '.tmp/sonar/', | ||
scmDisabled: true | ||
scmDisabled: true, | ||
excludedProperties:[] | ||
}; | ||
@@ -73,4 +74,4 @@ | ||
var value = _.result(object, key); | ||
if (value !== undefined) { | ||
if (value !== undefined && sonarOptions.excludedProperties.indexOf(prop) === -1) { | ||
args.push('-D' + prop + '=' + value); | ||
@@ -77,0 +78,0 @@ } |
@@ -242,3 +242,3 @@ 'use script'; | ||
it('should set the credentials when options.instance is defined (-D) for sonar-runner', function (done) { | ||
it('should set the credentials when options.instance is defined (-D) for sonar-runner', function (done) { | ||
var opts = DEFAULT_OPTIONS | ||
@@ -271,2 +271,3 @@ opts.defaultOutputDir = '.tmp/sonar/'; | ||
expect(mock.logOk[14]).toBe('-Dsonar.password=admin'); | ||
expect(mock.logOk[16]).toBe('-Dsonar.language=js'); | ||
@@ -276,3 +277,41 @@ done(); | ||
}); | ||
it('should exclude options that are excluded for sonar-runner', function (done) { | ||
var opts = DEFAULT_OPTIONS | ||
opts.defaultOutputDir = '.tmp/sonar/'; | ||
opts.runnerProperties = {}; | ||
opts.instance = { | ||
hostUrl: 'http://localhost:9000', | ||
jdbcUrl: 'jdbc:h2:tcp://localhost:9092/sonar', | ||
jdbcUsername: 'sonar', | ||
jdbcPassword: 'sonar', | ||
login: 'admin', | ||
password: 'admin' | ||
}; | ||
opts.excludedProperties = ['sonar.language']; | ||
var mock = getDefaultParameterMock(); | ||
mock.invoke(karmaSonar, function (err) { | ||
expect(mock.logError.length).toBe(0); | ||
expect(mock.logOk.length).toBe(23); | ||
expect(mock.logOk[3]).toBe('Dry-run'); | ||
expect(mock.logOk[4]).toBe('Sonar would have been triggered with the following sonar properties:'); | ||
console.log(mock.logOk) | ||
// options.instance | ||
expect(mock.logOk[9]).toBe('-Dsonar.host.url=http://localhost:9000'); | ||
expect(mock.logOk[10]).toBe('-Dsonar.jdbc.url=jdbc:h2:tcp://localhost:9092/sonar'); | ||
expect(mock.logOk[11]).toBe('-Dsonar.jdbc.username=sonar'); | ||
expect(mock.logOk[12]).toBe('-Dsonar.jdbc.password=sonar'); | ||
expect(mock.logOk[13]).toBe('-Dsonar.login=admin'); | ||
expect(mock.logOk[14]).toBe('-Dsonar.password=admin'); | ||
expect(mock.logOk[16]).not.toBe('-Dsonar.language=js'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
Sorry, the diff of this file is not supported yet
212711
61
1547
258