diff --git a/lib/helper/coverage.js b/lib/helper/coverage.js index 05514cc..22ae36b 100644 --- a/lib/helper/coverage.js +++ b/lib/helper/coverage.js @@ -29,14 +29,14 @@ module.exports = wd => { wd.addPromiseChainMethod('coverage', function(opts = {}) { let { coverageIgnore = program.coverageIgnore, - keys, + keys = [], } = opts; const tempDir = path.join(cwd, 'coverage', '.temp'); _.mkdir(tempDir); return this.execute('return { allKeys: Object.keys(window.__coverage__) }') .then(async res => { const { allKeys } = res; - if (!keys) { + if (!keys.length && allKeys) { keys = allKeys; } if (coverageIgnore) {