Skip to content

Commit

Permalink
fix(source-maps): reverts off by one fix for ignore (#123)
Browse files Browse the repository at this point in the history
* fix(off-by-one): reverts off by one fix for ignore

* chore: update snapshot
  • Loading branch information
bcoe committed Oct 8, 2020
1 parent 6d44899 commit a886fb8
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 55 deletions.
2 changes: 1 addition & 1 deletion lib/v8-to-istanbul.js
Expand Up @@ -107,7 +107,7 @@ module.exports = class V8ToIstanbul {
return true
}

return startCol < line.endCol && endCol >= line.startCol
return startCol <= line.endCol && endCol >= line.startCol
})
const startLineInstance = lines[0]
const endLineInstance = lines[lines.length - 1]
Expand Down
166 changes: 112 additions & 54 deletions tap-snapshots/test-v8-to-istanbul.js-TAP.test.js
Expand Up @@ -5,7 +5,7 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports['test/v8-to-istanbul.js TAP > must match branches snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match branches snapshot 1`] = `
Object {
"b": Object {
"0": Array [
Expand Down Expand Up @@ -36,7 +36,7 @@ Object {
1,
],
"9": Array [
1,
0,
],
},
"branchMap": Object {
Expand Down Expand Up @@ -275,15 +275,15 @@ Object {
"type": "branch",
},
"9": Object {
"line": 35,
"line": 34,
"loc": Object {
"end": Object {
"column": 0,
"line": 37,
},
"start": Object {
"column": -1,
"line": 35,
"column": 14,
"line": 34,
},
},
"locations": Array [
Expand All @@ -293,8 +293,8 @@ Object {
"line": 37,
},
"start": Object {
"column": -1,
"line": 35,
"column": 14,
"line": 34,
},
},
],
Expand Down Expand Up @@ -780,7 +780,7 @@ Object {
}
`

exports['test/v8-to-istanbul.js TAP > must match functions snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match functions snapshot 1`] = `
Object {
"b": Object {
"0": Array [
Expand Down Expand Up @@ -1761,7 +1761,7 @@ Object {
}
`

exports['test/v8-to-istanbul.js TAP > must match mixed new lines snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match mixed new lines snapshot 1`] = `
Object {
"b": Object {
"0": Array [
Expand Down Expand Up @@ -1867,7 +1867,7 @@ Object {
}
`

exports['test/v8-to-istanbul.js TAP > must match shebang snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match shebang snapshot 1`] = `
Object {
"b": Object {
"0": Array [
Expand All @@ -1879,15 +1879,15 @@ Object {
},
"branchMap": Object {
"0": Object {
"line": 2,
"line": 1,
"loc": Object {
"end": Object {
"column": 7,
"line": 8,
},
"start": Object {
"column": -1,
"line": 2,
"column": 19,
"line": 1,
},
},
"locations": Array [
Expand All @@ -1897,8 +1897,8 @@ Object {
"line": 8,
},
"start": Object {
"column": -1,
"line": 2,
"column": 19,
"line": 1,
},
},
],
Expand Down Expand Up @@ -2028,39 +2028,71 @@ Object {
}
`

exports['test/v8-to-istanbul.js TAP > must match source-map and minified source snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match source-map and minified source snapshot 1`] = `
Object {
"b": Object {
"0": Array [
0,
1,
],
"1": Array [
0,
],
"10": Array [
0,
],
"2": Array [
0,
],
"3": Array [
0,
],
"4": Array [
1,
0,
],
"5": Array [
0,
],
"6": Array [
0,
1,
],
"7": Array [
1,
0,
],
"8": Array [
0,
],
"9": Array [
1,
],
},
"branchMap": Object {
"0": Object {
"line": 31,
"loc": Object {
"end": Object {
"column": 10,
"line": 31,
},
"start": Object {
"column": 10,
"line": 31,
},
},
"locations": Array [
Object {
"end": Object {
"column": 10,
"line": 31,
},
"start": Object {
"column": 10,
"line": 31,
},
},
],
"type": "branch",
},
"1": Object {
"line": 5,
"loc": Object {
"end": Object {
Expand All @@ -2086,7 +2118,33 @@ Object {
],
"type": "branch",
},
"1": Object {
"10": Object {
"line": 29,
"loc": Object {
"end": Object {
"column": 10,
"line": 30,
},
"start": Object {
"column": 0,
"line": 29,
},
},
"locations": Array [
Object {
"end": Object {
"column": 10,
"line": 30,
},
"start": Object {
"column": 0,
"line": 29,
},
},
],
"type": "branch",
},
"2": Object {
"line": 8,
"loc": Object {
"end": Object {
Expand All @@ -2112,7 +2170,7 @@ Object {
],
"type": "branch",
},
"2": Object {
"3": Object {
"line": 11,
"loc": Object {
"end": Object {
Expand All @@ -2138,7 +2196,7 @@ Object {
],
"type": "branch",
},
"3": Object {
"4": Object {
"line": 14,
"loc": Object {
"end": Object {
Expand All @@ -2164,7 +2222,33 @@ Object {
],
"type": "branch",
},
"4": Object {
"5": Object {
"line": 31,
"loc": Object {
"end": Object {
"column": 10,
"line": 31,
},
"start": Object {
"column": 10,
"line": 31,
},
},
"locations": Array [
Object {
"end": Object {
"column": 10,
"line": 31,
},
"start": Object {
"column": 10,
"line": 31,
},
},
],
"type": "branch",
},
"6": Object {
"line": 1,
"loc": Object {
"end": Object {
Expand All @@ -2190,7 +2274,7 @@ Object {
],
"type": "branch",
},
"5": Object {
"7": Object {
"line": 1,
"loc": Object {
"end": Object {
Expand All @@ -2216,7 +2300,7 @@ Object {
],
"type": "branch",
},
"6": Object {
"8": Object {
"line": 2,
"loc": Object {
"end": Object {
Expand All @@ -2242,7 +2326,7 @@ Object {
],
"type": "branch",
},
"7": Object {
"9": Object {
"line": 20,
"loc": Object {
"end": Object {
Expand All @@ -2268,32 +2352,6 @@ Object {
],
"type": "branch",
},
"8": Object {
"line": 29,
"loc": Object {
"end": Object {
"column": 10,
"line": 30,
},
"start": Object {
"column": 0,
"line": 29,
},
},
"locations": Array [
Object {
"end": Object {
"column": 10,
"line": 30,
},
"start": Object {
"column": 0,
"line": 29,
},
},
],
"type": "branch",
},
},
"f": Object {
"0": 1,
Expand Down Expand Up @@ -2672,7 +2730,7 @@ Object {
}
`

exports['test/v8-to-istanbul.js TAP > must match source-map with multiple source files snapshot 1'] = `
exports[`test/v8-to-istanbul.js TAP > must match source-map with multiple source files snapshot 1`] = `
Object {
"b": Object {},
"branchMap": Object {},
Expand Down

0 comments on commit a886fb8

Please sign in to comment.