summaryrefslogtreecommitdiff
path: root/tools/wpt.ts
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-01-17 01:17:18 +0900
committerGitHub <noreply@github.com>2023-01-16 17:17:18 +0100
commit6da958d7ec31f2ffd21bb2beb8cc193a62afc55c (patch)
tree348fb3669348653b3907068b9ddc00f2652bdbfa /tools/wpt.ts
parent40134ffc99848c89e0ab88c03ca85b9122e2384b (diff)
chore: update dlint to v0.37.0 for GitHub Actions (#17295)
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
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(