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

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo