@@ -39,6 +39,7 @@ describe('config', () => {
3939 '/home/config6.js' : wrapCfg ( { reporters : 'junit' } ) ,
4040 '/home/config7.js' : wrapCfg ( { browsers : [ 'Chrome' , 'Firefox' ] } ) ,
4141 '/home/config8.js' : ( config ) => config . set ( { files : config . suite === 'e2e' ? [ 'tests/e2e.spec.js' ] : [ 'tests/unit.spec.js' ] } ) ,
42+ '/home/config9.js' : wrapCfg ( { client : { useIframe : false } } ) ,
4243 '/conf/invalid.js' : ( ) => { throw new SyntaxError ( 'Unexpected token =' ) } ,
4344 '/conf/exclude.js' : wrapCfg ( { exclude : [ 'one.js' , 'sub/two.js' ] } ) ,
4445 '/conf/absolute.js' : wrapCfg ( { files : [ 'http://some.com' , 'https://more.org/file.js' ] } ) ,
@@ -138,13 +139,21 @@ describe('config', () => {
138139 expect ( config . basePath ) . to . equal ( resolveWinPath ( '/abs/base' ) )
139140 } )
140141
141- it ( 'should override config with cli options, but not deep merge ' , ( ) => {
142+ it ( 'should override config with cli options if the config property is an array ' , ( ) => {
142143 // regression https://github.com/karma-runner/karma/issues/283
143144 var config = e . parseConfig ( '/home/config7.js' , { browsers : [ 'Safari' ] } )
144145
145146 expect ( config . browsers ) . to . deep . equal ( [ 'Safari' ] )
146147 } )
147148
149+ it ( 'should merge config with cli options if the config property is an object' , ( ) => {
150+ // regression https://github.com/karma-runner/grunt-karma/issues/165
151+ var config = e . parseConfig ( '/home/config9.js' , { client : { captureConsole : false } } )
152+
153+ expect ( config . client . useIframe ) . to . equal ( false )
154+ expect ( config . client . captureConsole ) . to . equal ( false )
155+ } )
156+
148157 it ( 'should have access to cli options in the config file' , ( ) => {
149158 var config = e . parseConfig ( '/home/config8.js' , { suite : 'e2e' } )
150159 expect ( patternsFrom ( config . files ) ) . to . deep . equal ( [ resolveWinPath ( '/home/tests/e2e.spec.js' ) ] )
0 commit comments