Skip to content

Commit ca963ca

Browse files
committed
test(coverage): drop the fixture knob no test turns
#3501 rewrote the deleted-function case to keep the `score` record while the source loses the function, which was the assertion that could actually fail. That left `noFunctions` declared and branched on with no caller, so the empty-fnMap path it exists to build is built by nobody and checked by nothing — the same shape as the test-only seam removed earlier, with the fixture standing in for a tool. Nothing else reads the knob, and 59 tests still pass, so the record builder is now the one shape every case uses.
1 parent f2e74d2 commit ca963ca

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

‎scripts/coverage-crap/run.test.ts‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ type CoverageOptions = Readonly<{
4848
hits?: number;
4949
/** Emit a count no execution can produce, which the sanitizer drops with the whole record. */
5050
corrupt?: boolean;
51-
/** Record the file with no functions in it, as a run over a deleted function's file reports. */
52-
noFunctions?: boolean;
5351
}>;
5452

5553
function istanbulRecord(file: string, options: CoverageOptions): Record<string, unknown> {
@@ -58,19 +56,17 @@ function istanbulRecord(file: string, options: CoverageOptions): Record<string,
5856
return {
5957
path: path.join(repo, file),
6058
statementMap: { 0: { start: line(from), end: line(to) } },
61-
fnMap: options.noFunctions
62-
? {}
63-
: {
64-
0: {
65-
name: 'score',
66-
decl: { start: line(from), end: line(from) },
67-
loc: { start: line(from), end: line(to) },
68-
line: from,
69-
},
70-
},
59+
fnMap: {
60+
0: {
61+
name: 'score',
62+
decl: { start: line(from), end: line(from) },
63+
loc: { start: line(from), end: line(to) },
64+
line: from,
65+
},
66+
},
7167
branchMap: {},
7268
s: { 0: options.corrupt ? -1 : (options.hits ?? 0) },
73-
f: options.noFunctions ? {} : { 0: options.hits ?? 0 },
69+
f: { 0: options.hits ?? 0 },
7470
b: {},
7571
};
7672
}

0 commit comments

Comments
 (0)