Skip to content

Commit bec66ab

Browse files
committed
fixup! test: improve WPT runner summary
1 parent 0511252 commit bec66ab

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/common/wpt.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -500,20 +500,14 @@ class StatusLoader {
500500

501501
load() {
502502
const dir = path.join(__dirname, '..', 'wpt');
503-
const jsonFile = path.join(dir, 'status', `${this.path}.json`);
504503
let result;
505504

506-
let fd;
507505
try {
508-
fd = fs.openSync(jsonFile, 'r');
506+
this.statusFile = `${this.path}.json`;
507+
const jsonFile = path.join(dir, 'status', this.statusFile);
508+
result = JSON.parse(fs.readFileSync(jsonFile, 'utf8'));
509509
} catch (err) {
510510
if (err?.code !== 'ENOENT') throw err;
511-
}
512-
if (fd) {
513-
this.statusFile = `${this.path}.json`;
514-
result = JSON.parse(fs.readFileSync(fd, 'utf8'));
515-
fs.closeSync(fd);
516-
} else {
517511
this.statusFile = `${this.path}.cjs`;
518512
result = require(path.join(dir, 'status', this.statusFile));
519513
}

0 commit comments

Comments
 (0)