diff --git a/docs/config/index.md b/docs/config/index.md index ae5e11f3e97d..59ab77ca8671 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -1374,7 +1374,7 @@ Sets thresholds for files matching the glob pattern. #### coverage.ignoreEmptyLines - **Type:** `boolean` -- **Default:** `false` +- **Default:** `true` (`false` in v1) - **Available for providers:** `'v8'` - **CLI:** `--coverage.ignoreEmptyLines=` diff --git a/packages/vitest/src/defaults.ts b/packages/vitest/src/defaults.ts index 4a065414a40f..a4fb82f97586 100644 --- a/packages/vitest/src/defaults.ts +++ b/packages/vitest/src/defaults.ts @@ -43,7 +43,7 @@ export const coverageConfigDefaults: ResolvedCoverageOptions = { reporter: [['text', {}], ['html', {}], ['clover', {}], ['json', {}]], extension: ['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte', '.marko'], allowExternal: false, - ignoreEmptyLines: false, + ignoreEmptyLines: true, processingConcurrency: Math.min(20, os.availableParallelism?.() ?? os.cpus().length), } diff --git a/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap b/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap index 82bde8fbc016..e340df56fc7d 100644 --- a/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap +++ b/test/coverage-test/coverage-report-tests/__snapshots__/v8.report.test.ts.snap @@ -173,16 +173,13 @@ exports[`v8 json report 1`] = ` "path": "/src/Counter/Counter.component.ts", "s": { "0": 1, - "1": 1, "10": 1, "11": 1, "12": 0, "13": 0, - "14": 1, "15": 1, "16": 2, "17": 2, - "18": 1, "19": 1, "2": 1, "20": 0, @@ -190,12 +187,10 @@ exports[`v8 json report 1`] = ` "22": 1, "23": 1, "3": 1, - "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, - "9": 1, }, "statementMap": { "0": { @@ -208,16 +203,6 @@ exports[`v8 json report 1`] = ` "line": 1, }, }, - "1": { - "end": { - "column": 0, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, "10": { "end": { "column": 12, @@ -258,16 +243,6 @@ exports[`v8 json report 1`] = ` "line": 14, }, }, - "14": { - "end": { - "column": 0, - "line": 15, - }, - "start": { - "column": 0, - "line": 15, - }, - }, "15": { "end": { "column": 21, @@ -298,16 +273,6 @@ exports[`v8 json report 1`] = ` "line": 18, }, }, - "18": { - "end": { - "column": 0, - "line": 19, - }, - "start": { - "column": 0, - "line": 19, - }, - }, "19": { "end": { "column": 38, @@ -378,16 +343,6 @@ exports[`v8 json report 1`] = ` "line": 4, }, }, - "4": { - "end": { - "column": 0, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, "5": { "end": { "column": 11, @@ -428,16 +383,6 @@ exports[`v8 json report 1`] = ` "line": 9, }, }, - "9": { - "end": { - "column": 0, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, }, }, "/src/Counter/Counter.vue": { @@ -536,18 +481,10 @@ exports[`v8 json report 1`] = ` "path": "/src/Counter/Counter.vue", "s": { "0": 1, - "1": 1, - "10": 1, - "11": 1, - "12": 1, - "13": 1, - "2": 1, "3": 1, "4": 1, "5": 1, - "6": 1, "7": 1, - "8": 1, "9": 1, }, "statementMap": { @@ -561,66 +498,6 @@ exports[`v8 json report 1`] = ` "line": 1, }, }, - "1": { - "end": { - "column": 0, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, - "10": { - "end": { - "column": 14, - "line": 11, - }, - "start": { - "column": 0, - "line": 11, - }, - }, - "11": { - "end": { - "column": 25, - "line": 12, - }, - "start": { - "column": 0, - "line": 12, - }, - }, - "12": { - "end": { - "column": 8, - "line": 13, - }, - "start": { - "column": 0, - "line": 13, - }, - }, - "13": { - "end": { - "column": 11, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, - "2": { - "end": { - "column": 10, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, "3": { "end": { "column": 27, @@ -651,16 +528,6 @@ exports[`v8 json report 1`] = ` "line": 6, }, }, - "6": { - "end": { - "column": 0, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, "7": { "end": { "column": 25, @@ -671,16 +538,6 @@ exports[`v8 json report 1`] = ` "line": 8, }, }, - "8": { - "end": { - "column": 27, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, "9": { "end": { "column": 8, @@ -702,8 +559,6 @@ exports[`v8 json report 1`] = ` "path": "/src/Counter/index.ts", "s": { "0": 1, - "1": 1, - "2": 1, }, "statementMap": { "0": { @@ -716,26 +571,6 @@ exports[`v8 json report 1`] = ` "line": 1, }, }, - "1": { - "end": { - "column": 0, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, - "2": { - "end": { - "column": 21, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, }, }, "/src/Defined.vue": { @@ -779,24 +614,10 @@ exports[`v8 json report 1`] = ` "s": { "0": 1, "1": 1, - "10": 1, "11": 1, - "12": 1, - "13": 1, - "14": 1, - "15": 1, - "16": 1, - "17": 1, - "18": 1, - "19": 1, - "2": 1, - "3": 1, "4": 1, "5": 1, - "6": 0, "7": 0, - "8": 1, - "9": 1, }, "statementMap": { "0": { @@ -819,16 +640,6 @@ exports[`v8 json report 1`] = ` "line": 2, }, }, - "10": { - "end": { - "column": 10, - "line": 11, - }, - "start": { - "column": 0, - "line": 11, - }, - }, "11": { "end": { "column": 15, @@ -839,201 +650,71 @@ exports[`v8 json report 1`] = ` "line": 12, }, }, - "12": { + "4": { "end": { - "column": 11, - "line": 13, + "column": 12, + "line": 5, }, "start": { "column": 0, - "line": 13, + "line": 5, }, }, - "13": { + "5": { "end": { - "column": 0, - "line": 14, + "column": 34, + "line": 6, }, "start": { "column": 0, - "line": 14, + "line": 6, }, }, - "14": { + "7": { "end": { - "column": 90, - "line": 15, + "column": 36, + "line": 8, }, "start": { "column": 0, - "line": 15, + "line": 8, }, }, - "15": { - "end": { - "column": 25, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, + }, + }, + "/src/Hello.vue": { + "all": false, + "b": { + "0": [ + 3, + ], + }, + "branchMap": { + "0": { + "line": 7, + "loc": { + "end": { + "column": 55, + "line": 7, + }, + "start": { + "column": 24, + "line": 7, + }, }, - }, - "16": { - "end": { - "column": 6, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, - "17": { - "end": { - "column": 25, - "line": 18, - }, - "start": { - "column": 0, - "line": 18, - }, - }, - "18": { - "end": { - "column": 1, - "line": 19, - }, - "start": { - "column": 0, - "line": 19, - }, - }, - "19": { - "end": { - "column": 8, - "line": 20, - }, - "start": { - "column": 0, - "line": 20, - }, - }, - "2": { - "end": { - "column": 0, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, - "3": { - "end": { - "column": 31, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, - "4": { - "end": { - "column": 12, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, - "5": { - "end": { - "column": 34, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, - "6": { - "end": { - "column": 4, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, - "7": { - "end": { - "column": 36, - "line": 8, - }, - "start": { - "column": 0, - "line": 8, - }, - }, - "8": { - "end": { - "column": 9, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, - "9": { - "end": { - "column": 0, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, - }, - }, - "/src/Hello.vue": { - "all": false, - "b": { - "0": [ - 3, - ], - }, - "branchMap": { - "0": { - "line": 7, - "loc": { - "end": { - "column": 55, - "line": 7, - }, - "start": { - "column": 24, - "line": 7, - }, - }, - "locations": [ - { - "end": { - "column": 55, - "line": 7, - }, - "start": { - "column": 24, - "line": 7, - }, - }, - ], - "type": "branch", + "locations": [ + { + "end": { + "column": 55, + "line": 7, + }, + "start": { + "column": 24, + "line": 7, + }, + }, + ], + "type": "branch", }, }, "f": {}, @@ -1042,21 +723,13 @@ exports[`v8 json report 1`] = ` "s": { "0": 1, "1": 1, - "10": 1, - "11": 1, "12": 1, "13": 1, - "14": 1, "15": 1, - "16": 1, - "2": 1, "3": 1, - "4": 1, "5": 1, "6": 1, - "7": 1, "8": 1, - "9": 1, }, "statementMap": { "0": { @@ -1079,26 +752,6 @@ exports[`v8 json report 1`] = ` "line": 2, }, }, - "10": { - "end": { - "column": 0, - "line": 11, - }, - "start": { - "column": 0, - "line": 11, - }, - }, - "11": { - "end": { - "column": 10, - "line": 12, - }, - "start": { - "column": 0, - "line": 12, - }, - }, "12": { "end": { "column": 53, @@ -1119,16 +772,6 @@ exports[`v8 json report 1`] = ` "line": 14, }, }, - "14": { - "end": { - "column": 6, - "line": 15, - }, - "start": { - "column": 0, - "line": 15, - }, - }, "15": { "end": { "column": 11, @@ -1139,26 +782,6 @@ exports[`v8 json report 1`] = ` "line": 16, }, }, - "16": { - "end": { - "column": 11, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, - "2": { - "end": { - "column": 0, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, "3": { "end": { "column": 46, @@ -1169,16 +792,6 @@ exports[`v8 json report 1`] = ` "line": 4, }, }, - "4": { - "end": { - "column": 0, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, "5": { "end": { "column": 20, @@ -1199,16 +812,6 @@ exports[`v8 json report 1`] = ` "line": 7, }, }, - "7": { - "end": { - "column": 0, - "line": 8, - }, - "start": { - "column": 0, - "line": 8, - }, - }, "8": { "end": { "column": 19, @@ -1219,16 +822,6 @@ exports[`v8 json report 1`] = ` "line": 9, }, }, - "9": { - "end": { - "column": 9, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, }, }, "/src/decorators.ts": { @@ -1435,31 +1028,22 @@ exports[`v8 json report 1`] = ` "path": "/src/decorators.ts", "s": { "0": 1, - "1": 1, - "10": 0, "11": 0, "12": 0, "13": 1, "14": 1, - "15": 1, "16": 1, "17": 1, "18": 1, "19": 1, "2": 1, "20": 1, - "21": 1, - "22": 1, - "23": 1, "24": 1, - "25": 1, "26": 1, "3": 1, "4": 1, - "5": 1, "6": 1, "7": 1, - "8": 1, "9": 1, }, "statementMap": { @@ -1473,27 +1057,7 @@ exports[`v8 json report 1`] = ` "line": 1, }, }, - "1": { - "end": { - "column": 14, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, - "10": { - "end": { - "column": 23, - "line": 11, - }, - "start": { - "column": 0, - "line": 11, - }, - }, - "11": { + "11": { "end": { "column": 21, "line": 12, @@ -1533,16 +1097,6 @@ exports[`v8 json report 1`] = ` "line": 15, }, }, - "15": { - "end": { - "column": 0, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, - }, - }, "16": { "end": { "column": 23, @@ -1603,36 +1157,6 @@ exports[`v8 json report 1`] = ` "line": 21, }, }, - "21": { - "end": { - "column": 0, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, - }, - }, - "22": { - "end": { - "column": 24, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, - "23": { - "end": { - "column": 0, - "line": 24, - }, - "start": { - "column": 0, - "line": 24, - }, - }, "24": { "end": { "column": 36, @@ -1643,16 +1167,6 @@ exports[`v8 json report 1`] = ` "line": 25, }, }, - "25": { - "end": { - "column": 0, - "line": 26, - }, - "start": { - "column": 0, - "line": 26, - }, - }, "26": { "end": { "column": 1, @@ -1683,16 +1197,6 @@ exports[`v8 json report 1`] = ` "line": 5, }, }, - "5": { - "end": { - "column": 21, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, "6": { "end": { "column": 21, @@ -1713,16 +1217,6 @@ exports[`v8 json report 1`] = ` "line": 8, }, }, - "8": { - "end": { - "column": 0, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, "9": { "end": { "column": 36, @@ -2259,50 +1753,28 @@ exports[`v8 json report 1`] = ` "0": 1, "1": 1, "10": 1, - "11": 1, - "12": 1, - "13": 1, - "14": 1, - "15": 1, "16": 1, - "17": 1, "18": 1, - "19": 1, "2": 1, "20": 1, "21": 1, - "22": 1, "23": 1, "24": 1, - "25": 1, "26": 1, "27": 1, - "28": 1, "29": 1, - "3": 1, "30": 1, - "31": 1, "32": 1, - "33": 1, - "34": 1, - "35": 1, - "36": 1, - "37": 1, "38": 1, - "39": 1, "4": 1, "40": 1, - "41": 1, "42": 1, "43": 1, - "44": 1, "45": 1, "46": 1, "5": 1, - "6": 1, "7": 1, "8": 1, - "9": 1, }, "statementMap": { "0": { @@ -2335,56 +1807,6 @@ exports[`v8 json report 1`] = ` "line": 11, }, }, - "11": { - "end": { - "column": 53, - "line": 12, - }, - "start": { - "column": 0, - "line": 12, - }, - }, - "12": { - "end": { - "column": 23, - "line": 13, - }, - "start": { - "column": 0, - "line": 13, - }, - }, - "13": { - "end": { - "column": 23, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, - "14": { - "end": { - "column": 1, - "line": 15, - }, - "start": { - "column": 0, - "line": 15, - }, - }, - "15": { - "end": { - "column": 23, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, - }, - }, "16": { "end": { "column": 20, @@ -2395,16 +1817,6 @@ exports[`v8 json report 1`] = ` "line": 17, }, }, - "17": { - "end": { - "column": 0, - "line": 18, - }, - "start": { - "column": 0, - "line": 18, - }, - }, "18": { "end": { "column": 40, @@ -2415,16 +1827,6 @@ exports[`v8 json report 1`] = ` "line": 19, }, }, - "19": { - "end": { - "column": 0, - "line": 20, - }, - "start": { - "column": 0, - "line": 20, - }, - }, "2": { "end": { "column": 40, @@ -2455,16 +1857,6 @@ exports[`v8 json report 1`] = ` "line": 22, }, }, - "22": { - "end": { - "column": 0, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, "23": { "end": { "column": 18, @@ -2485,16 +1877,6 @@ exports[`v8 json report 1`] = ` "line": 25, }, }, - "25": { - "end": { - "column": 0, - "line": 26, - }, - "start": { - "column": 0, - "line": 26, - }, - }, "26": { "end": { "column": 43, @@ -2515,16 +1897,6 @@ exports[`v8 json report 1`] = ` "line": 28, }, }, - "28": { - "end": { - "column": 0, - "line": 29, - }, - "start": { - "column": 0, - "line": 29, - }, - }, "29": { "end": { "column": 27, @@ -2535,16 +1907,6 @@ exports[`v8 json report 1`] = ` "line": 30, }, }, - "3": { - "end": { - "column": 0, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, "30": { "end": { "column": 20, @@ -2555,16 +1917,6 @@ exports[`v8 json report 1`] = ` "line": 31, }, }, - "31": { - "end": { - "column": 0, - "line": 32, - }, - "start": { - "column": 0, - "line": 32, - }, - }, "32": { "end": { "column": 27, @@ -2575,137 +1927,57 @@ exports[`v8 json report 1`] = ` "line": 33, }, }, - "33": { + "38": { "end": { - "column": 53, - "line": 34, + "column": 20, + "line": 39, }, "start": { "column": 0, - "line": 34, + "line": 39, }, }, - "34": { + "4": { "end": { - "column": 37, - "line": 35, + "column": 43, + "line": 5, }, "start": { "column": 0, - "line": 35, + "line": 5, }, }, - "35": { + "40": { "end": { - "column": 23, - "line": 36, + "column": 58, + "line": 41, }, "start": { "column": 0, - "line": 36, + "line": 41, }, }, - "36": { + "42": { "end": { - "column": 1, - "line": 37, + "column": 31, + "line": 43, }, "start": { "column": 0, - "line": 37, + "line": 43, }, }, - "37": { + "43": { "end": { - "column": 23, - "line": 38, + "column": 48, + "line": 44, }, "start": { "column": 0, - "line": 38, + "line": 44, }, }, - "38": { - "end": { - "column": 20, - "line": 39, - }, - "start": { - "column": 0, - "line": 39, - }, - }, - "39": { - "end": { - "column": 0, - "line": 40, - }, - "start": { - "column": 0, - "line": 40, - }, - }, - "4": { - "end": { - "column": 43, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, - "40": { - "end": { - "column": 58, - "line": 41, - }, - "start": { - "column": 0, - "line": 41, - }, - }, - "41": { - "end": { - "column": 0, - "line": 42, - }, - "start": { - "column": 0, - "line": 42, - }, - }, - "42": { - "end": { - "column": 31, - "line": 43, - }, - "start": { - "column": 0, - "line": 43, - }, - }, - "43": { - "end": { - "column": 48, - "line": 44, - }, - "start": { - "column": 0, - "line": 44, - }, - }, - "44": { - "end": { - "column": 0, - "line": 45, - }, - "start": { - "column": 0, - "line": 45, - }, - }, - "45": { + "45": { "end": { "column": 18, "line": 46, @@ -2735,16 +2007,6 @@ exports[`v8 json report 1`] = ` "line": 6, }, }, - "6": { - "end": { - "column": 0, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, "7": { "end": { "column": 27, @@ -2765,23 +2027,13 @@ exports[`v8 json report 1`] = ` "line": 9, }, }, - "9": { - "end": { - "column": 0, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, }, }, "/src/empty-lines.ts": { "all": true, "b": { "0": [ - 0, + 1, ], }, "branchMap": { @@ -2813,7 +2065,7 @@ exports[`v8 json report 1`] = ` }, }, "f": { - "0": 0, + "0": 1, }, "fnMap": { "0": { @@ -2843,47 +2095,17 @@ exports[`v8 json report 1`] = ` }, "path": "/src/empty-lines.ts", "s": { - "0": 0, "1": 0, "10": 0, - "11": 0, - "12": 0, - "13": 0, "14": 0, - "15": 0, "16": 0, "17": 0, - "18": 0, - "19": 0, - "2": 0, - "20": 0, - "21": 0, - "22": 0, - "23": 0, - "24": 0, - "25": 0, - "26": 0, "27": 0, "28": 0, - "3": 0, - "4": 0, - "5": 0, - "6": 0, "7": 0, - "8": 0, "9": 0, }, "statementMap": { - "0": { - "end": { - "column": 65, - "line": 1, - }, - "start": { - "column": 0, - "line": 1, - }, - }, "1": { "end": { "column": 43, @@ -2904,36 +2126,6 @@ exports[`v8 json report 1`] = ` "line": 11, }, }, - "11": { - "end": { - "column": 0, - "line": 12, - }, - "start": { - "column": 0, - "line": 12, - }, - }, - "12": { - "end": { - "column": 32, - "line": 13, - }, - "start": { - "column": 0, - "line": 13, - }, - }, - "13": { - "end": { - "column": 0, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, "14": { "end": { "column": 27, @@ -2944,16 +2136,6 @@ exports[`v8 json report 1`] = ` "line": 15, }, }, - "15": { - "end": { - "column": 38, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, - }, - }, "16": { "end": { "column": 12, @@ -2974,247 +2156,97 @@ exports[`v8 json report 1`] = ` "line": 18, }, }, - "18": { + "27": { "end": { - "column": 0, - "line": 19, + "column": 14, + "line": 28, }, "start": { "column": 0, - "line": 19, + "line": 28, }, }, - "19": { + "28": { "end": { - "column": 33, - "line": 20, + "column": 1, + "line": 29, }, "start": { "column": 0, - "line": 20, + "line": 29, }, }, - "2": { + "7": { "end": { - "column": 5, - "line": 3, + "column": 27, + "line": 8, }, "start": { "column": 0, - "line": 3, + "line": 8, }, }, - "20": { + "9": { "end": { - "column": 13, - "line": 21, + "column": 12, + "line": 10, }, "start": { "column": 0, - "line": 21, + "line": 10, }, }, - "21": { - "end": { - "column": 11, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, + }, + }, + "/src/file-to-change.ts": { + "all": true, + "b": { + "0": [ + 0, + ], + }, + "branchMap": { + "0": { + "line": 1, + "loc": { + "end": { + "column": 1, + "line": 7, + }, + "start": { + "column": 133, + "line": 1, + }, }, + "locations": [ + { + "end": { + "column": 1, + "line": 7, + }, + "start": { + "column": 133, + "line": 1, + }, + }, + ], + "type": "branch", }, - "22": { - "end": { - "column": 22, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, - "23": { - "end": { - "column": 7, - "line": 24, - }, - "start": { - "column": 0, - "line": 24, - }, - }, - "24": { - "end": { - "column": 5, - "line": 25, - }, - "start": { - "column": 0, - "line": 25, - }, - }, - "25": { - "end": { - "column": 3, - "line": 26, - }, - "start": { - "column": 0, - "line": 26, - }, - }, - "26": { - "end": { - "column": 0, - "line": 27, - }, - "start": { - "column": 0, - "line": 27, - }, - }, - "27": { - "end": { - "column": 14, - "line": 28, - }, - "start": { - "column": 0, - "line": 28, - }, - }, - "28": { - "end": { - "column": 1, - "line": 29, - }, - "start": { - "column": 0, - "line": 29, - }, - }, - "3": { - "end": { - "column": 10, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, - "4": { - "end": { - "column": 9, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, - "5": { - "end": { - "column": 12, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, - "6": { - "end": { - "column": 5, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, - "7": { - "end": { - "column": 27, - "line": 8, - }, - "start": { - "column": 0, - "line": 8, - }, - }, - "8": { - "end": { - "column": 38, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, - "9": { - "end": { - "column": 12, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, - }, - }, - "/src/file-to-change.ts": { - "all": true, - "b": { - "0": [ - 0, - ], - }, - "branchMap": { - "0": { - "line": 1, - "loc": { - "end": { - "column": 1, - "line": 7, - }, - "start": { - "column": 133, - "line": 1, - }, - }, - "locations": [ - { - "end": { - "column": 1, - "line": 7, - }, - "start": { - "column": 133, - "line": 1, - }, - }, - ], - "type": "branch", - }, - }, - "f": { - "0": 0, - }, - "fnMap": { - "0": { - "decl": { - "end": { - "column": 1, - "line": 7, - }, - "start": { - "column": 133, - "line": 1, - }, + }, + "f": { + "0": 0, + }, + "fnMap": { + "0": { + "decl": { + "end": { + "column": 1, + "line": 7, + }, + "start": { + "column": 133, + "line": 1, + }, }, "line": 1, "loc": { @@ -3235,7 +2267,6 @@ exports[`v8 json report 1`] = ` "0": 0, "1": 0, "2": 0, - "3": 0, "4": 0, "5": 0, "6": 0, @@ -3271,16 +2302,6 @@ exports[`v8 json report 1`] = ` "line": 3, }, }, - "3": { - "end": { - "column": 0, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, "4": { "end": { "column": 37, @@ -3537,64 +2558,25 @@ exports[`v8 json report 1`] = ` }, "path": "/src/function-count.ts", "s": { - "0": 1, - "1": 1, "10": 1, "11": 1, "12": 1, - "13": 1, "14": 1, - "15": 1, - "16": 1, "17": 1, "18": 1, "19": 1, - "2": 1, "20": 1, - "21": 1, - "22": 1, "23": 1, "24": 0, "25": 0, - "26": 1, - "27": 1, "28": 0, "29": 0, - "3": 1, "30": 0, - "31": 1, - "32": 1, "33": 1, "34": 1, "35": 1, - "4": 1, - "5": 1, - "6": 1, - "7": 1, - "8": 1, - "9": 1, }, "statementMap": { - "0": { - "end": { - "column": 2, - "line": 1, - }, - "start": { - "column": 0, - "line": 1, - }, - }, - "1": { - "end": { - "column": 25, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, "10": { "end": { "column": 18, @@ -3625,16 +2607,6 @@ exports[`v8 json report 1`] = ` "line": 13, }, }, - "13": { - "end": { - "column": 0, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, "14": { "end": { "column": 7, @@ -3645,37 +2617,17 @@ exports[`v8 json report 1`] = ` "line": 15, }, }, - "15": { + "17": { "end": { - "column": 0, - "line": 16, + "column": 26, + "line": 18, }, "start": { "column": 0, - "line": 16, + "line": 18, }, }, - "16": { - "end": { - "column": 27, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, - "17": { - "end": { - "column": 26, - "line": 18, - }, - "start": { - "column": 0, - "line": 18, - }, - }, - "18": { + "18": { "end": { "column": 9, "line": 19, @@ -3695,16 +2647,6 @@ exports[`v8 json report 1`] = ` "line": 20, }, }, - "2": { - "end": { - "column": 25, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, "20": { "end": { "column": 1, @@ -3715,26 +2657,6 @@ exports[`v8 json report 1`] = ` "line": 21, }, }, - "21": { - "end": { - "column": 0, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, - }, - }, - "22": { - "end": { - "column": 31, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, "23": { "end": { "column": 25, @@ -3765,26 +2687,6 @@ exports[`v8 json report 1`] = ` "line": 26, }, }, - "26": { - "end": { - "column": 0, - "line": 27, - }, - "start": { - "column": 0, - "line": 27, - }, - }, - "27": { - "end": { - "column": 31, - "line": 28, - }, - "start": { - "column": 0, - "line": 28, - }, - }, "28": { "end": { "column": 19, @@ -3805,16 +2707,6 @@ exports[`v8 json report 1`] = ` "line": 30, }, }, - "3": { - "end": { - "column": 24, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, "30": { "end": { "column": 1, @@ -3825,26 +2717,6 @@ exports[`v8 json report 1`] = ` "line": 31, }, }, - "31": { - "end": { - "column": 0, - "line": 32, - }, - "start": { - "column": 0, - "line": 32, - }, - }, - "32": { - "end": { - "column": 27, - "line": 33, - }, - "start": { - "column": 0, - "line": 33, - }, - }, "33": { "end": { "column": 18, @@ -3875,66 +2747,6 @@ exports[`v8 json report 1`] = ` "line": 36, }, }, - "4": { - "end": { - "column": 26, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, - "5": { - "end": { - "column": 3, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, - "6": { - "end": { - "column": 0, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, - "7": { - "end": { - "column": 50, - "line": 8, - }, - "start": { - "column": 0, - "line": 8, - }, - }, - "8": { - "end": { - "column": 0, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, - "9": { - "end": { - "column": 27, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, }, }, "/src/implicitElse.ts": { @@ -4005,10 +2817,8 @@ exports[`v8 json report 1`] = ` "s": { "0": 1, "1": 1, - "2": 1, "3": 1, "4": 1, - "5": 1, "6": 1, "7": 1, }, @@ -4033,16 +2843,6 @@ exports[`v8 json report 1`] = ` "line": 2, }, }, - "2": { - "end": { - "column": 0, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, "3": { "end": { "column": 16, @@ -4063,16 +2863,6 @@ exports[`v8 json report 1`] = ` "line": 5, }, }, - "5": { - "end": { - "column": 0, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, "6": { "end": { "column": 10, @@ -4265,9 +3055,7 @@ exports[`v8 json report 1`] = ` "path": "/src/index.mts", "s": { "0": 1, - "1": 1, "2": 1, - "3": 1, "4": 1, "5": 1, "6": 1, @@ -4283,16 +3071,6 @@ exports[`v8 json report 1`] = ` "line": 1, }, }, - "1": { - "end": { - "column": 0, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, "2": { "end": { "column": 23, @@ -4303,16 +3081,6 @@ exports[`v8 json report 1`] = ` "line": 3, }, }, - "3": { - "end": { - "column": 0, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, "4": { "end": { "column": 50, @@ -4753,345 +3521,180 @@ exports[`v8 json report 1`] = ` "s": { "0": 2, "1": 2, - "10": 4, - "11": 0, - "12": 0, - "13": 0, - "14": 4, - "15": 4, - "16": 1, - "17": 1, - "18": 1, - "19": 3, - "2": 2, - "20": 0, - "21": 0, - "22": 0, - "23": 3, - "24": 1, - "25": 1, - "26": 1, - "27": 2, - "28": 2, - "29": 2, - "3": 2, - "30": 2, - "4": 2, - "5": 2, - "6": 4, - "7": 4, - "8": 4, - "9": 4, + "10": 0, + "11": 3, + "12": 1, + "13": 1, + "14": 2, + "15": 2, + "2": 4, + "3": 0, + "4": 0, + "5": 4, + "6": 1, + "7": 1, + "8": 3, + "9": 0, }, "statementMap": { "0": { "end": { - "column": 3, - "line": 1, + "column": 40, + "line": 4, }, "start": { "column": 0, - "line": 1, + "line": 4, }, }, "1": { "end": { - "column": 55, - "line": 2, + "column": 43, + "line": 6, }, "start": { "column": 0, - "line": 2, + "line": 6, }, }, "10": { "end": { - "column": 27, - "line": 11, + "column": 3, + "line": 23, }, "start": { "column": 0, - "line": 11, + "line": 23, }, }, "11": { "end": { - "column": 38, - "line": 12, + "column": 34, + "line": 24, }, "start": { "column": 0, - "line": 12, + "line": 24, }, }, "12": { "end": { "column": 13, - "line": 13, + "line": 26, }, "start": { "column": 0, - "line": 13, + "line": 26, }, }, "13": { "end": { "column": 3, - "line": 14, + "line": 27, }, "start": { "column": 0, - "line": 14, + "line": 27, }, }, "14": { "end": { - "column": 12, - "line": 15, + "column": 14, + "line": 30, }, "start": { "column": 0, - "line": 15, + "line": 30, }, }, "15": { "end": { - "column": 32, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, - }, - }, - "16": { - "end": { - "column": 34, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, - "17": { - "end": { - "column": 12, - "line": 18, - }, - "start": { - "column": 0, - "line": 18, - }, - }, - "18": { - "end": { - "column": 3, - "line": 19, - }, - "start": { - "column": 0, - "line": 19, - }, - }, - "19": { - "end": { - "column": 34, - "line": 20, + "column": 1, + "line": 31, }, "start": { "column": 0, - "line": 20, + "line": 31, }, }, "2": { "end": { - "column": 3, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, - "20": { - "end": { - "column": 38, - "line": 21, - }, - "start": { - "column": 0, - "line": 21, - }, - }, - "21": { - "end": { - "column": 13, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, - }, - }, - "22": { - "end": { - "column": 3, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, - "23": { - "end": { - "column": 34, - "line": 24, - }, - "start": { - "column": 0, - "line": 24, - }, - }, - "24": { - "end": { - "column": 34, - "line": 25, - }, - "start": { - "column": 0, - "line": 25, - }, - }, - "25": { - "end": { - "column": 13, - "line": 26, - }, - "start": { - "column": 0, - "line": 26, - }, - }, - "26": { - "end": { - "column": 3, - "line": 27, - }, - "start": { - "column": 0, - "line": 27, - }, - }, - "27": { - "end": { - "column": 0, - "line": 28, - }, - "start": { - "column": 0, - "line": 28, - }, - }, - "28": { - "end": { - "column": 61, - "line": 29, - }, - "start": { - "column": 0, - "line": 29, - }, - }, - "29": { - "end": { - "column": 14, - "line": 30, + "column": 27, + "line": 11, }, "start": { "column": 0, - "line": 30, + "line": 11, }, }, "3": { "end": { - "column": 40, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, - "30": { - "end": { - "column": 1, - "line": 31, + "column": 13, + "line": 13, }, "start": { "column": 0, - "line": 31, + "line": 13, }, }, "4": { "end": { - "column": 0, - "line": 5, + "column": 3, + "line": 14, }, "start": { "column": 0, - "line": 5, + "line": 14, }, }, "5": { "end": { - "column": 43, - "line": 6, + "column": 32, + "line": 16, }, "start": { "column": 0, - "line": 6, + "line": 16, }, }, "6": { "end": { - "column": 4, - "line": 7, + "column": 12, + "line": 18, }, "start": { "column": 0, - "line": 7, + "line": 18, }, }, "7": { "end": { - "column": 64, - "line": 8, + "column": 3, + "line": 19, }, "start": { "column": 0, - "line": 8, + "line": 19, }, }, "8": { "end": { - "column": 35, - "line": 9, + "column": 34, + "line": 20, }, "start": { "column": 0, - "line": 9, + "line": 20, }, }, "9": { "end": { - "column": 5, - "line": 10, + "column": 13, + "line": 22, }, "start": { "column": 0, - "line": 10, + "line": 22, }, }, }, @@ -5220,7 +3823,6 @@ exports[`v8 json report 1`] = ` "1": 1, "2": 1, "3": 1, - "4": 1, "5": 1, "6": 1, "7": 1, @@ -5267,16 +3869,6 @@ exports[`v8 json report 1`] = ` "line": 4, }, }, - "4": { - "end": { - "column": 0, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, "5": { "end": { "column": 22, @@ -5502,21 +4094,17 @@ exports[`v8 json report 1`] = ` "10": 0, "11": 0, "12": 0, - "13": 1, "14": 1, "15": 1, "16": 1, "17": 1, "18": 1, - "19": 1, "2": 0, "20": 2, "3": 0, "4": 0, - "5": 1, "6": 1, "7": 1, - "8": 1, "9": 1, }, "statementMap": { @@ -5570,16 +4158,6 @@ exports[`v8 json report 1`] = ` "line": 13, }, }, - "13": { - "end": { - "column": 0, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, "14": { "end": { "column": 26, @@ -5630,16 +4208,6 @@ exports[`v8 json report 1`] = ` "line": 19, }, }, - "19": { - "end": { - "column": 0, - "line": 20, - }, - "start": { - "column": 0, - "line": 20, - }, - }, "2": { "end": { "column": 16, @@ -5680,16 +4248,6 @@ exports[`v8 json report 1`] = ` "line": 5, }, }, - "5": { - "end": { - "column": 0, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, "6": { "end": { "column": 12, @@ -5710,16 +4268,6 @@ exports[`v8 json report 1`] = ` "line": 8, }, }, - "8": { - "end": { - "column": 0, - "line": 9, - }, - "start": { - "column": 0, - "line": 9, - }, - }, "9": { "end": { "column": 18, @@ -5736,7 +4284,7 @@ exports[`v8 json report 1`] = ` "all": true, "b": { "0": [ - 0, + 1, ], }, "branchMap": { @@ -5764,341 +4312,125 @@ exports[`v8 json report 1`] = ` }, }, ], - "type": "branch", - }, - }, - "f": { - "0": 0, - }, - "fnMap": { - "0": { - "decl": { - "end": { - "column": 1, - "line": 47, - }, - "start": { - "column": 984, - "line": 1, - }, - }, - "line": 1, - "loc": { - "end": { - "column": 1, - "line": 47, - }, - "start": { - "column": 984, - "line": 1, - }, - }, - "name": "(empty-report)", - }, - }, - "path": "/src/untested-file.ts", - "s": { - "0": 0, - "1": 0, - "10": 0, - "11": 0, - "12": 0, - "13": 0, - "14": 0, - "15": 0, - "16": 0, - "17": 0, - "18": 0, - "19": 0, - "2": 0, - "20": 0, - "21": 0, - "22": 0, - "23": 0, - "24": 0, - "25": 0, - "26": 0, - "27": 0, - "28": 0, - "29": 0, - "3": 0, - "30": 0, - "31": 0, - "32": 0, - "33": 0, - "34": 0, - "35": 0, - "36": 0, - "4": 0, - "43": 0, - "44": 0, - "45": 0, - "46": 0, - "5": 0, - "6": 0, - "7": 0, - "8": 0, - "9": 0, - }, - "statementMap": { - "0": { - "end": { - "column": 2, - "line": 1, - }, - "start": { - "column": 0, - "line": 1, - }, - }, - "1": { - "end": { - "column": 68, - "line": 2, - }, - "start": { - "column": 0, - "line": 2, - }, - }, - "10": { - "end": { - "column": 0, - "line": 11, - }, - "start": { - "column": 0, - "line": 11, - }, - }, - "11": { - "end": { - "column": 36, - "line": 12, - }, - "start": { - "column": 0, - "line": 12, - }, - }, - "12": { - "end": { - "column": 36, - "line": 13, - }, - "start": { - "column": 0, - "line": 13, - }, - }, - "13": { - "end": { - "column": 14, - "line": 14, - }, - "start": { - "column": 0, - "line": 14, - }, - }, - "14": { - "end": { - "column": 1, - "line": 15, - }, - "start": { - "column": 0, - "line": 15, - }, - }, - "15": { - "end": { - "column": 0, - "line": 16, - }, - "start": { - "column": 0, - "line": 16, - }, - }, - "16": { - "end": { - "column": 30, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, - "17": { - "end": { - "column": 0, - "line": 18, - }, - "start": { - "column": 0, - "line": 18, - }, - }, - "18": { - "end": { - "column": 41, - "line": 19, - }, - "start": { - "column": 0, - "line": 19, - }, - }, - "19": { - "end": { - "column": 36, - "line": 20, - }, - "start": { - "column": 0, - "line": 20, - }, - }, - "2": { - "end": { - "column": 25, - "line": 3, - }, - "start": { - "column": 0, - "line": 3, - }, - }, - "20": { - "end": { - "column": 14, - "line": 21, - }, - "start": { - "column": 0, - "line": 21, - }, - }, - "21": { - "end": { - "column": 1, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, - }, - }, - "22": { - "end": { - "column": 0, - "line": 23, - }, - "start": { - "column": 0, - "line": 23, - }, - }, - "23": { - "end": { - "column": 65, - "line": 24, - }, - "start": { - "column": 0, - "line": 24, - }, - }, - "24": { - "end": { - "column": 33, - "line": 25, - }, - "start": { - "column": 0, - "line": 25, - }, - }, - "25": { - "end": { - "column": 13, - "line": 26, + "type": "branch", + }, + }, + "f": { + "0": 1, + }, + "fnMap": { + "0": { + "decl": { + "end": { + "column": 1, + "line": 47, + }, + "start": { + "column": 984, + "line": 1, + }, }, - "start": { - "column": 0, - "line": 26, + "line": 1, + "loc": { + "end": { + "column": 1, + "line": 47, + }, + "start": { + "column": 984, + "line": 1, + }, }, + "name": "(empty-report)", }, - "26": { + }, + "path": "/src/untested-file.ts", + "s": { + "11": 0, + "13": 0, + "14": 0, + "18": 0, + "20": 0, + "21": 0, + "23": 0, + "32": 0, + "34": 0, + "35": 0, + "45": 0, + "46": 0, + "7": 0, + "8": 0, + "9": 0, + }, + "statementMap": { + "11": { "end": { - "column": 11, - "line": 27, + "column": 36, + "line": 12, }, "start": { "column": 0, - "line": 27, + "line": 12, }, }, - "27": { + "13": { "end": { - "column": 22, - "line": 28, + "column": 14, + "line": 14, }, "start": { "column": 0, - "line": 28, + "line": 14, }, }, - "28": { + "14": { "end": { - "column": 7, - "line": 29, + "column": 1, + "line": 15, }, "start": { "column": 0, - "line": 29, + "line": 15, }, }, - "29": { + "18": { "end": { - "column": 5, - "line": 30, + "column": 41, + "line": 19, }, "start": { "column": 0, - "line": 30, + "line": 19, }, }, - "3": { + "20": { "end": { - "column": 2, - "line": 4, + "column": 14, + "line": 21, }, "start": { "column": 0, - "line": 4, + "line": 21, }, }, - "30": { + "21": { "end": { - "column": 3, - "line": 31, + "column": 1, + "line": 22, }, "start": { "column": 0, - "line": 31, + "line": 22, }, }, - "31": { + "23": { "end": { - "column": 0, - "line": 32, + "column": 65, + "line": 24, }, "start": { "column": 0, - "line": 32, + "line": 24, }, }, "32": { @@ -6111,16 +4443,6 @@ exports[`v8 json report 1`] = ` "line": 33, }, }, - "33": { - "end": { - "column": 38, - "line": 34, - }, - "start": { - "column": 0, - "line": 34, - }, - }, "34": { "end": { "column": 25, @@ -6141,46 +4463,6 @@ exports[`v8 json report 1`] = ` "line": 36, }, }, - "36": { - "end": { - "column": 0, - "line": 37, - }, - "start": { - "column": 0, - "line": 37, - }, - }, - "4": { - "end": { - "column": 0, - "line": 5, - }, - "start": { - "column": 0, - "line": 5, - }, - }, - "43": { - "end": { - "column": 0, - "line": 44, - }, - "start": { - "column": 0, - "line": 44, - }, - }, - "44": { - "end": { - "column": 36, - "line": 45, - }, - "start": { - "column": 0, - "line": 45, - }, - }, "45": { "end": { "column": 41, @@ -6201,26 +4483,6 @@ exports[`v8 json report 1`] = ` "line": 47, }, }, - "5": { - "end": { - "column": 65, - "line": 6, - }, - "start": { - "column": 0, - "line": 6, - }, - }, - "6": { - "end": { - "column": 0, - "line": 7, - }, - "start": { - "column": 0, - "line": 7, - }, - }, "7": { "end": { "column": 40, @@ -6535,27 +4797,19 @@ exports[`v8 json report 1`] = ` "1": 1, "10": 0, "11": 0, - "12": 1, "13": 1, "14": 1, "15": 1, - "16": 1, "17": 1, "18": 1, - "19": 1, "2": 1, "20": 1, - "21": 0, "22": 0, "23": 0, - "24": 1, - "3": 1, "4": 1, "5": 2, "6": 2, - "7": 1, "8": 1, - "9": 0, }, "statementMap": { "0": { @@ -6598,16 +4852,6 @@ exports[`v8 json report 1`] = ` "line": 12, }, }, - "12": { - "end": { - "column": 0, - "line": 13, - }, - "start": { - "column": 0, - "line": 13, - }, - }, "13": { "end": { "column": 33, @@ -6638,16 +4882,6 @@ exports[`v8 json report 1`] = ` "line": 16, }, }, - "16": { - "end": { - "column": 0, - "line": 17, - }, - "start": { - "column": 0, - "line": 17, - }, - }, "17": { "end": { "column": 21, @@ -6668,16 +4902,6 @@ exports[`v8 json report 1`] = ` "line": 19, }, }, - "19": { - "end": { - "column": 0, - "line": 20, - }, - "start": { - "column": 0, - "line": 20, - }, - }, "2": { "end": { "column": 1, @@ -6698,16 +4922,6 @@ exports[`v8 json report 1`] = ` "line": 21, }, }, - "21": { - "end": { - "column": 31, - "line": 22, - }, - "start": { - "column": 0, - "line": 22, - }, - }, "22": { "end": { "column": 14, @@ -6728,26 +4942,6 @@ exports[`v8 json report 1`] = ` "line": 24, }, }, - "24": { - "end": { - "column": 0, - "line": 25, - }, - "start": { - "column": 0, - "line": 25, - }, - }, - "3": { - "end": { - "column": 0, - "line": 4, - }, - "start": { - "column": 0, - "line": 4, - }, - }, "4": { "end": { "column": 48, @@ -6778,16 +4972,6 @@ exports[`v8 json report 1`] = ` "line": 7, }, }, - "7": { - "end": { - "column": 0, - "line": 8, - }, - "start": { - "column": 0, - "line": 8, - }, - }, "8": { "end": { "column": 46, @@ -6798,16 +4982,6 @@ exports[`v8 json report 1`] = ` "line": 9, }, }, - "9": { - "end": { - "column": 31, - "line": 10, - }, - "start": { - "column": 0, - "line": 10, - }, - }, }, }, } diff --git a/test/coverage-test/coverage-report-tests/generic.report.test.ts b/test/coverage-test/coverage-report-tests/generic.report.test.ts index e9ba58f5cc34..fba6cbbd30a4 100644 --- a/test/coverage-test/coverage-report-tests/generic.report.test.ts +++ b/test/coverage-test/coverage-report-tests/generic.report.test.ts @@ -108,8 +108,8 @@ test('thresholds.autoUpdate updates thresholds', async () => { expect(summary.functions.pct).toBe(60) if (process.env.COVERAGE_PROVIDER === 'v8') { - expect(summary.statements.pct).toBe(86.11) - expect(summary.lines.pct).toBe(86.11) + expect(summary.statements.pct).toBe(70.58) + expect(summary.lines.pct).toBe(70.58) } else { expect(summary.statements.pct).toBe(71.42) diff --git a/test/coverage-test/coverage-report-tests/empty-lines.test.ts b/test/coverage-test/coverage-report-tests/ignore-empty-lines.test.ts similarity index 100% rename from test/coverage-test/coverage-report-tests/empty-lines.test.ts rename to test/coverage-test/coverage-report-tests/ignore-empty-lines.test.ts diff --git a/test/coverage-test/coverage-report-tests/include-empty-lines.test.ts b/test/coverage-test/coverage-report-tests/include-empty-lines.test.ts new file mode 100644 index 000000000000..0bd9ce1de1ea --- /dev/null +++ b/test/coverage-test/coverage-report-tests/include-empty-lines.test.ts @@ -0,0 +1,41 @@ +import { beforeAll, expect, test } from 'vitest' +import libCoverage from 'istanbul-lib-coverage' + +import { readCoverageJson } from './utils' + +// Key is 1-based line number +type LineCoverage = Record + +let coveredFileLines: LineCoverage +let uncoveredFileLines: LineCoverage + +beforeAll(async () => { + const coverageJson = await readCoverageJson('./coverage/coverage-final.json') + const coverageMap = libCoverage.createCoverageMap(coverageJson as any) + + coveredFileLines = coverageMap.fileCoverageFor('/src/empty-lines.ts').getLineCoverage() as typeof coveredFileLines + uncoveredFileLines = coverageMap.fileCoverageFor('/src/untested-file.ts').getLineCoverage() as typeof uncoveredFileLines +}) + +test('lines are included', async () => { + for (const line of range(29)) { + expect(coveredFileLines[line], `Line #${line}`).not.toBe(undefined) + expect(coveredFileLines[line], `Line #${line}`).toBeTypeOf('number') + } + + for (const lines of [range(37), range(4, { base: 44 })]) { + for (const line of lines) { + expect(uncoveredFileLines[line], `Line #${line}`).not.toBe(undefined) + expect(uncoveredFileLines[line], `Line #${line}`).toBeTypeOf('number') + } + } +}) + +test('lines with ignore hints are ignored', () => { + for (const line of range(6, { base: 38 })) + expect(uncoveredFileLines[line], `Line #${line}`).toBe(undefined) +}) + +function range(count: number, options: { base: number } = { base: 1 }) { + return Array(count).fill(0).map((_, i) => options.base + i) +} diff --git a/test/coverage-test/testing-options.mjs b/test/coverage-test/testing-options.mjs index 269995e8f408..5c792801cf21 100644 --- a/test/coverage-test/testing-options.mjs +++ b/test/coverage-test/testing-options.mjs @@ -97,13 +97,28 @@ const testCases = [ coverage: { provider: 'v8', reporter: 'json', - ignoreEmptyLines: true, all: true, include: ['src/empty-lines.ts', 'src/untested-file.ts'], }, }, assertionConfig: { - include: ['coverage-report-tests/empty-lines.test.ts'], + include: ['coverage-report-tests/ignore-empty-lines.test.ts'], + }, + }, + { + testConfig: { + name: 'include empty lines', + include: ['option-tests/empty-lines.test.ts'], + coverage: { + provider: 'v8', + reporter: 'json', + ignoreEmptyLines: false, + all: true, + include: ['src/empty-lines.ts', 'src/untested-file.ts'], + }, + }, + assertionConfig: { + include: ['coverage-report-tests/include-empty-lines.test.ts'], }, }, {