diff --git a/index.js b/index.js index 6d74d0831..8bb560c9d 100755 --- a/index.js +++ b/index.js @@ -408,11 +408,16 @@ class NYC { async getCoverageMapFromAllCoverageFiles (baseDirectory) { const map = libCoverage.createCoverageMap({}) + const files = await this.coverageFiles(baseDirectory) - const data = await this.coverageData(baseDirectory) - data.forEach(report => { - map.merge(report) - }) + await pMap( + files, + async f => { + const report = await this.coverageFileLoad(f, baseDirectory) + map.merge(report) + }, + { concurrency: os.cpus().length } + ) map.data = await this.sourceMaps.remapCoverage(map.data)