From 17325fc082e6e62902cd875f081c8355be850bd3 Mon Sep 17 00:00:00 2001 From: bcoe Date: Sat, 16 Nov 2019 18:21:02 -0800 Subject: [PATCH] feat: adds special (empty-report) block --- lib/v8-to-istanbul.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/v8-to-istanbul.js b/lib/v8-to-istanbul.js index 30c50da2..1c53d0eb 100644 --- a/lib/v8-to-istanbul.js +++ b/lib/v8-to-istanbul.js @@ -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]