Uh oh!
There was an error while loading. Please reload this page.
allow coverage instrumentation of multiple files - #125
Conversation
fyockm
commented
Feb 2, 2016
Hi @bjouhier! Instead of overloading the lib/coverage.js options={dir: 'coverage',reporters: ['lcov','json'],files: null};Not quite as clean, but then the matcher=function(file){if(options.coverage.files){if(typeofoptions.coverage.files==='string')returnfile.indexOf(options.coverage)===0;elseif(options.coverage.filesinstanceofRegExp)returnoptions.coverage.test(file);}returnfile===options.code.path;}An even better solution might utilize pattern globbing, but perhaps as a future enhancement. |
There was a problem hiding this comment.
I think instead of string, we should use an array here, otherwise its fine ...
bjouhier
commented
Feb 2, 2016
@fyockm Hi Drew!!! That's a good point. I've followed your suggestion to use |
kof
commented
Feb 2, 2016
merged |
bjouhier
commented
Feb 2, 2016
Thanks @kof |
allow coverage instrumentation of multiple files
bjouhier
commented
Feb 2, 2016
kof
commented
Feb 2, 2016
thats true, do we really need regexp there? |
kof
commented
Feb 2, 2016
Can you add some tests? |
bjouhier
commented
Feb 2, 2016
I can manage without regexps. Looked like a cool and easy-to-implement feature but it's only cool. I'll remove regexps and add tests but I'll do it a bit later. |
kof
commented
Feb 2, 2016
👍 |
This PR is a quick hack to enable code coverage on multiple files. It allows you to set the coverage option to:
codeoption will be included in the coverage report.