Skip to content

Commit

Permalink
fix: Merge reports with concurrency limit instead of fetching everyth…
Browse files Browse the repository at this point in the history
…ing in memory (istanbuljs#1263)
  • Loading branch information
canonic-epicure committed Mar 23, 2020
1 parent a5fa23a commit 9c95e2d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.js
Expand Up @@ -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)

Expand Down

0 comments on commit 9c95e2d

Please sign in to comment.