summaryrefslogtreecommitdiff
path: root/tools/wpt.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wpt.ts')
-rwxr-xr-xtools/wpt.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts
index 338c89464..5d0c2e762 100755
--- a/tools/wpt.ts
+++ b/tools/wpt.ts
@@ -285,7 +285,7 @@ function assertAllExpectationsHaveTests(
const missingTests: string[] = [];
function walk(parentExpectation: Expectation, parent: string) {
- for (const key in parentExpectation) {
+ for (const [key, expectation] of Object.entries(parentExpectation)) {
const path = `${parent}/${key}`;
if (
filter &&
@@ -293,7 +293,6 @@ function assertAllExpectationsHaveTests(
) {
continue;
}
- const expectation = parentExpectation[key];
if (typeof expectation == "boolean" || Array.isArray(expectation)) {
if (!tests.has(path)) {
missingTests.push(path);
@@ -368,8 +367,8 @@ async function update() {
const currentExpectation = getExpectation();
- for (const path in resultTests) {
- const { passed, failed, testSucceeded } = resultTests[path];
+ for (const result of Object.values(resultTests)) {
+ const { passed, failed, testSucceeded } = result;
let finalExpectation: boolean | string[];
if (failed.length == 0 && testSucceeded) {
finalExpectation = true;
@@ -655,9 +654,7 @@ function discoverTestsToRun(
parentExpectation: Expectation | string[] | boolean,
prefix: string,
) {
- for (const key in parentFolder) {
- const entry = parentFolder[key];
-
+ for (const [key, entry] of Object.entries(parentFolder)) {
if (Array.isArray(entry)) {
for (
const [path, options] of entry.slice(