In one of the projects I work for, we have just added karma to run unit tests. When reviewing the MR of a coworker, I noticed the karma.conf.js (the configuration file) has 120 lines, which seems to be a lot for me.
While reading each configuration, I noticed many of those configurations are the already default values.
Some configurations examples
//address that the server will listen on, '0.0.0.0' is default listenAddress: '0.0.0.0', //hostname to be used when capturing browsers, 'localhost' is default hostname: 'localhost', //the port where the web server will be listening, 9876 is default port: 9876, browserDisconnectTimeout: 5000, //how long will Karma wait for a message from a browser before disconnecting from it, 10000 is default browserNoActivityTimeout: 10000, // timeout for capturing a browser, 60000 is default captureTimeout: 60000,
and there are few more. The config file is about 120 lines, but removing default settings it will be less than 70 lines (and more if we remove comments)
Is it a good practice, in general, to explicitly write down the default values? Or is it preferrable to only state what's not changed and rely on defaults? (That might change in the future)
I feel the second way is more declarative (we only configure what needs to be configured)
Note The karma thing is just an example, it can be applied to other configurations of other libraries that require so