Skip to content

Commit

Permalink
feat: adds special (empty-report) block (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Nov 23, 2019
1 parent 63505f5 commit e981cc1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/v8-to-istanbul.js
Expand Up @@ -82,8 +82,14 @@ module.exports = class V8ToIstanbul {
startCol,
endCol
} = this._maybeRemapStartColEndCol(range)

const lines = this.source.lines.filter(line => {
// Upstream tooling can provide a block with the functionName
// (empty-report), this will result in a report that has all
// lines zeroed out.
if (block.functionName === '(empty-report)') {
line.count = 0
return true
}
return startCol <= line.endCol && endCol >= line.startCol
})
const startLineInstance = lines[0]
Expand Down

0 comments on commit e981cc1

Please sign in to comment.