karma-runner / grunt-karma

Grunt plugin for Karma.
MIT License
468 stars 116 forks source link

Browsers are merged not overridden #94

Closed pflannery closed 10 years ago

pflannery commented 10 years ago

In the documentation here it says that we can override the browsers array with different browser specs but I've found that it's only merging them.

So if I have

karma: {
  options: {
    runnerPort: 9999,
    browsers: ['Chrome', 'Firefox']
  },
  continuous: {
    singleRun: true,
    browsers: ['PhantomJS']
  }
}

and I run grunt karma:continuous I end up with

['PhantomJS', 'Firefox']

Only browsers[0] from continuous gets overridden but browsers[1] from options is left intact.

Can I suggest changing this line here to:

data = _.merge(options, data)
data.browsers = this.data.browsers;

I can PR if there isn't something I'm missing?

pflannery commented 10 years ago

@Dignifiedquire great thanks!