Skip to content

Commit

Permalink
fix: we should ignore functions and branches (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed May 2, 2019
1 parent 50c9f18 commit d468559
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/v8-to-istanbul.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ module.exports = class V8ToIstanbul {
b: {}
}
this.branches.forEach((branch, index) => {
const ignore = this.source.lines[branch.startLine - 1].ignore
branches.branchMap[`${index}`] = branch.toIstanbul()
branches.b[`${index}`] = [branch.count]
branches.b[`${index}`] = [ignore ? 1 : branch.count]
})
return branches
}
Expand All @@ -178,8 +179,9 @@ module.exports = class V8ToIstanbul {
f: {}
}
this.functions.forEach((fn, index) => {
const ignore = this.source.lines[fn.startLine - 1].ignore
functions.fnMap[`${index}`] = fn.toIstanbul()
functions.f[`${index}`] = fn.count
functions.f[`${index}`] = ignore ? 1 : fn.count
})
return functions
}
Expand Down

0 comments on commit d468559

Please sign in to comment.