Skip to content

Commit a0988d5

Browse files
authored
Update list of untestable features (#2770)
* Update list of untestable features * Update caveats list on homepage * Add additional untestable categories * Top-level await can't be tested by collector
1 parent 629cbc4 commit a0988d5

File tree

3 files changed

+899
-375
lines changed

3 files changed

+899
-375
lines changed

scripts/feature-coverage.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ const traverseFeatures = (
106106
return features;
107107
};
108108

109+
/**
110+
* Indicates whether a feature identifier is untestable, based upon a curated list.
111+
* @param ident - The identifier to check.
112+
* @returns A boolean on whether the feature identifier is a known untestable feature.
113+
*/
114+
const isUntestable = (ident: string) => {
115+
return (
116+
untestableFeatures.features.includes(ident) ||
117+
untestableFeatures.categories.some((c) => ident.startsWith(c + "."))
118+
);
119+
};
120+
109121
/**
110122
* Finds the missing entries in the given array of entries compared to the array of all entries.
111123
* @param entries - The array of entries to check against.
@@ -127,14 +139,14 @@ const findMissing = (entries: string[], allEntries: string[]): FeatureList => {
127139
all: allEntries,
128140
},
129141
testable: {
130-
missing: missing.filter((f) => !untestableFeatures.includes(f)),
131-
found: found.filter((f) => !untestableFeatures.includes(f)),
132-
all: allEntries.filter((f) => !untestableFeatures.includes(f)),
142+
missing: missing.filter((f) => !isUntestable(f)),
143+
found: found.filter((f) => !isUntestable(f)),
144+
all: allEntries.filter((f) => !isUntestable(f)),
133145
},
134146
untestable: {
135-
missing: missing.filter((f) => untestableFeatures.includes(f)),
136-
found: found.filter((f) => untestableFeatures.includes(f)),
137-
all: allEntries.filter((f) => untestableFeatures.includes(f)),
147+
missing: missing.filter((f) => isUntestable(f)),
148+
found: found.filter((f) => isUntestable(f)),
149+
all: allEntries.filter((f) => isUntestable(f)),
138150
},
139151
};
140152
};
@@ -303,7 +315,7 @@ const main = (bcd: CompatData, tests: Tests) => {
303315
100.0
304316
).toFixed(
305317
2,
306-
)}%)} of {cyan ${data.testable.all.length}/${data.all.all.length}} entries tracked in {red.bold ${direction[1]}} ({red ${data.testable.missing.length} (${(
318+
)}%)} of {cyan ${data.testable.all.length}/${data.all.all.length}} entries in {red.bold ${direction[1]}} ({red ${data.testable.missing.length} (${(
307319
(data.testable.missing.length / data.testable.all.length) *
308320
100.0
309321
).toFixed(2)}%/${(
@@ -312,7 +324,7 @@ const main = (bcd: CompatData, tests: Tests) => {
312324
).toFixed(2)}%)} missing, {gray ${data.untestable.all.length} (${(
313325
(data.untestable.all.length / data.all.all.length) *
314326
100.0
315-
).toFixed(2)}%) untestable})`,
327+
).toFixed(2)}%) untestable by collector})`,
316328
);
317329

318330
if (firstEntry) {

0 commit comments

Comments
 (0)