karma-runner / grunt-karma

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

custom client properties were droped #110

Closed huangyingjie closed 10 years ago

huangyingjie commented 10 years ago

hi,I need to add some YUI_config to the client, so I can use them on the page by fetching from __karma__.config

 // in karma.conf.js
    config.client["YUI_config"] = {
        debug: true,
        comboBase: comboBase,
        root: 'yui/' + yuiVersion + '/build/',
        comboSep: ';',
        combine: true
    }

It is ok when I use karma start, but failure when use grunt-karma.

//using grunt-karma
window.__karma__.config = {"args":[],"useIframe":true,"captureConsole":true}

How can I fix this problem? I do not want to pass them from command line, it is too long and inconvenient.

huangyingjie commented 10 years ago

I read the code, found that the options.client defined in Gruntfile.js will always override the one which defined in karma.conf.js, even though I didn't define it in Gruntfile. I suggest karma make a deep clone for options.client, not just replace it.