MCPcopy Index your code
hub / github.com/nodejs/node / load

Method load

test/common/wpt.js:502–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
528const kPass = 'pass';

Callers 5

constructorMethod · 0.45
test.jsFile · 0.45
spawnFunction · 0.45
wasi-preview-1.jsFile · 0.45
getModuleTypeStatsFunction · 0.45

Calls 10

grepMethod · 0.95
addRulesMethod · 0.80
parseMethod · 0.65
matchMethod · 0.65
requireFunction · 0.50
joinMethod · 0.45
readFileSyncMethod · 0.45
pathMethod · 0.45
pushMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected