Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data merge concurrency #1293

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ test/build/
self-coverage/
*.swp
needs-transpile.js
/.idea
coreyfarrell marked this conversation as resolved.
Show resolved Hide resolved
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)
canonic-epicure marked this conversation as resolved.
Show resolved Hide resolved
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