Skip to content

Commit 18d22c7

Browse files
committed
docs(coverage): keep the unscored wording an example list
The sentence named the two upstream defects as the reason every record is dropped, but the rule is any negative, null, or fractional count, so a new cause would read as a known one. Say "for example" and pin the wording in the report test.
1 parent 978544e commit 18d22c7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ test('the report names touched functions and unscored files', () => {
8282
assert.match(report, /1 touched function\(s\) at or above 30/);
8383
assert.match(report, /\| `src\/a\.ts:10` run \| 42\.0 \| 6 \| 20% \|/);
8484
assert.match(report, /Unscored: 1 file\(s\).*`src\/odd\.ts`/);
85+
// The known upstream causes are examples, not the whole rule: any negative, null, or fractional
86+
// count is dropped, and naming only the two would misdiagnose a new one.
87+
assert.match(report, /Unscored: 1 file\(s\).*for example/);
8588
});
8689

8790
test('an empty report says none and lists no table', () => {

‎scripts/coverage-crap/model.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export function renderCrapReport(input: {
130130
lines.push(
131131
'',
132132
`Unscored: ${dropped.length} file(s) with counts no execution can produce ` +
133-
`(unresolved script wrapper offset, or a negative branch path count; see patches/): ` +
134-
`${dropped.map((file) => `\`${file}\``).join(', ')}`,
133+
`(for example, an unresolved script wrapper offset or a negative branch path count, ` +
134+
`both fixed under patches/): ${dropped.map((file) => `\`${file}\``).join(', ')}`,
135135
);
136136
}
137137
return `${lines.join('\n')}\n`;

0 commit comments

Comments
 (0)