Skip to content

Commit

Permalink
fix: handle edge-case surrounding merging two file coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
romansemko authored and bcoe committed Jan 18, 2017
1 parent 6c9c65e commit 22e154c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/file.js
Expand Up @@ -250,6 +250,10 @@ FileCoverage.prototype.merge = function (other) {
var i,
retArray = that.data.b[k],
secondArray = other.b[k];
if (!retArray) {
that.data.b[k] = secondArray;
return;
}
for (i = 0; i < retArray.length; i += 1) {
retArray[i] += secondArray[i];
}
Expand Down

0 comments on commit 22e154c

Please sign in to comment.