v8-to-istanbul icon indicating copy to clipboard operation
v8-to-istanbul copied to clipboard

early return causes wrong line to be identified as uncovered

Open bcoe opened this issue 4 years ago • 0 comments

There's a slight hiccup with merging logic that was brought to my attention here.

https://user-images.githubusercontent.com/1324510/52922996-26a90980-3360-11e9-907c-6fa464fec932.png

Here's the output that we're failing to process appropriately:

{
      "scriptId": "61",
      "url": "file:///Users/benjamincoe/bcoe/c8/foo.js",
      "functions": [
        {
          "functionName": "",
          "ranges": [
            {
              "startOffset": 0,
              "endOffset": 112,
              "count": 1
            }
          ],
          "isBlockCoverage": true
        },
        {
          "functionName": "test",
          "ranges": [
            {
              "startOffset": 0,
              "endOffset": 97,
              "count": 1
            },
            {
              "startOffset": 44,
              "endOffset": 96,
              "count": 0
            }
          ],
          "isBlockCoverage": true
        },
        {
          "functionName": "bar",
          "ranges": [
            {
              "startOffset": 50,
              "endOffset": 95,
              "count": 1
            }
          ],
          "isBlockCoverage": true
        }
      ]
    }

bcoe avatar Nov 30 '19 21:11 bcoe