node.js - When use istanbul, is there any way to dynamic require config.js? -


enter image description here

the logenable write in config.js, there way change value during testing? can improve branch coverage.

you ignore parts of code testing: https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md

skip if or else path /* istanbul ignore if */ or /* istanbul ignore else */ respectively.

for other cases, skip next 'thing' in source with: /* istanbul ignore next */

or add single test checks logging functions both logging enabled , disabled (you can override required modules, config, example proxyquire: https://github.com/thlorenz/proxyquire).


Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

c# - Randomly pick a specific int from a 2D Array -

php - Angularjs http.delete is not working after deploying project on server -