Skip to content

Commit

Permalink
feat: Merge all client.args as suggested in #79.
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Mar 14, 2014
1 parent 168f7b7 commit b658ec9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = function(grunt) {
],
frameworks: ['mocha'],
plugins: plugins,
//client: {captureConsole: true}
},
single: {
singleRun: true
Expand Down
17 changes: 13 additions & 4 deletions tasks/grunt-karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,31 @@ module.exports = function(grunt) {
return '--grep=' + arg;
});
}
options.client.args = args;
if (_.isArray(options.client.args)) {
options.client.args = options.client.args.concat(args);
} else {
options.client.args = args;
}

// Merge karma default options
options.client = _.defaults(options.client, {
_.defaults(options.client, {
args: [],
useIframe: true,
captureConsole: true
});

var data = this.data;
var opts = _.cloneDeep(options);
// Merge options onto data, with data taking precedence.
data = _.merge(options, data);
var data = _.merge(opts, this.data);

// But override the browsers array.
data.browsers = this.data.browsers || data.browsers;

// Merge client.args
if (_.isArray(this.data.client.args)) {
data.client.args = this.data.client.args.concat(options.client.args);
}

if (data.configFile) {
data.configFile = path.resolve(data.configFile);
data.configFile = grunt.template.process(data.configFile);
Expand Down

0 comments on commit b658ec9

Please sign in to comment.