()
| 500 | } |
| 501 | |
| 502 | load() { |
| 503 | const dir = path.join(__dirname, '..', 'wpt'); |
| 504 | let result; |
| 505 | |
| 506 | try { |
| 507 | this.statusFile = `${this.path}.json`; |
| 508 | const jsonFile = path.join(dir, 'status', this.statusFile); |
| 509 | result = JSON.parse(fs.readFileSync(jsonFile, 'utf8')); |
| 510 | } catch (err) { |
| 511 | if (err?.code !== 'ENOENT') throw err; |
| 512 | this.statusFile = `${this.path}.cjs`; |
| 513 | result = require(path.join(dir, 'status', this.statusFile)); |
| 514 | } |
| 515 | |
| 516 | this.rules.addRules(result); |
| 517 | |
| 518 | const subDir = fixtures.path('wpt', this.path); |
| 519 | const list = this.grep(subDir); |
| 520 | for (const file of list) { |
| 521 | const relativePath = path.relative(subDir, file); |
| 522 | const match = this.rules.match(relativePath); |
| 523 | this.specs.push(...WPTTestSpec.from(this.path, relativePath, match)); |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | const kPass = 'pass'; |
no test coverage detected