web icon indicating copy to clipboard operation
web copied to clipboard

mergeConfigs should merge objects recursively

Open DavidPeicho opened this issue 1 year ago • 1 comments

Calling startTestRunner with this config:

startTestRunner({
    config: {
            testFramework: {
                config: {
                    grep: 'GrepSomething'
                },
            },
    },
});

would fail if another configuration down the line contain any testFramework parameters. It looks like mergeConfig should probably recursively merge objects, just like it does with arrays here.

DavidPeicho avatar Mar 29 '24 00:03 DavidPeicho

Not sure if there was a specific reason to not do it like that? cc @thepassle @LarsDenBakker

Did you consider implementing or using 3rd party merge for your use-case? IIUC, both configs are in your code: one in the config file and one in the JS file where you invoke startTestRunner ? It's often hard to define a single merge strategy that works for everyone, so if you can use smth custom for yourself, that can be a better strategy.

bashmish avatar Apr 02 '24 09:04 bashmish