Skip to content

Commit e29d667

Browse files
committed
fixup! test: skip url WPT subtests instead of modifying test script
1 parent 24691dd commit e29d667

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/common/wpt.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,16 @@ class StatusLoader {
503503
const jsonFile = path.join(dir, 'status', `${this.path}.json`);
504504
let result;
505505

506-
if (fs.existsSync(jsonFile)) {
506+
let fd;
507+
try {
508+
fd = fs.openSync(jsonFile, 'r');
509+
} catch (err) {
510+
if (err?.code !== 'ENOENT') throw err;
511+
}
512+
if (fd) {
507513
this.statusFile = `${this.path}.json`;
508-
result = JSON.parse(fs.readFileSync(jsonFile, 'utf8'));
514+
result = JSON.parse(fs.readFileSync(fd, 'utf8'));
515+
fs.closeSync(fd);
509516
} else {
510517
this.statusFile = `${this.path}.cjs`;
511518
result = require(path.join(dir, 'status', this.statusFile));

0 commit comments

Comments
 (0)