Lines Matching defs:const
3 const assert = require('assert');
4 const fixtures = require('../common/fixtures');
5 const fs = require('fs');
6 const fsPromises = fs.promises;
7 const path = require('path');
8 const events = require('events');
9 const os = require('os');
10 const { inspect } = require('util');
11 const { Worker } = require('worker_threads');
14 const { node: version } = process.versions; // e.g. 18.13.0, 20.0.0-nightly202302078e6e215481
15 const release = /^\d+\.\d+\.\d+$/.test(version);
16 const browser = {
47 const string = low || high; // Only one of these alternates can match
66 const result = {
71 const subtest = {
93 const url = new URL(result.test, 'http://wpt');
100 const prev = JSON.parse(fs.readFileSync('out/wpt/wptreport.json'));
125 const harnessMock = {
161 const base = path.dirname(from);
176 const file = this.toRealFilePath(from, url);
211 const result = path.normalize(pattern).replace(/[-/\\^$+?.()|[\]{}]/g, '\\$&');
227 for (const key of Object.keys(rules)) {
231 const normalizedPath = path.normalize(key);
238 const result = [];
239 const exact = this.exactMatch[file];
243 for (const item of this.patternMatch) {
269 for (const item of rules) {
271 for (const req of item.requires) {
305 const kIntlRequirement = {
332 const current = this.currentIntl;
343 const intlRequirements = new IntlRequirement();
363 const list = fs.readdirSync(dir);
364 for (const file of list) {
365 const filepath = path.join(dir, file);
366 const stat = fs.statSync(filepath);
368 const list = this.grep(filepath);
381 const dir = path.join(__dirname, '..', 'wpt');
382 const statusFile = path.join(dir, 'status', `${this.path}.json`);
383 const result = JSON.parse(fs.readFileSync(statusFile, 'utf8'));
386 const subDir = fixtures.path('wpt', this.path);
387 const list = this.grep(subDir);
388 for (const file of list) {
389 const relativePath = path.relative(subDir, file);
390 const match = this.rules.match(relativePath);
397 const kPass = 'pass';
398 const kFail = 'fail';
399 const kSkip = 'skip';
400 const kTimeout = 'timeout';
401 const kIncomplete = 'incomplete';
402 const kUncaught = 'uncaught';
403 const NODE_UNCAUGHT = 100;
470 const globalThisInitScript = this.globalThisInitScripts.join('\n\n//===\n');
505 const lazyProperties = [
526 const script = lazyProperties.map((name) => `globalThis.${name};`).join('\n');
538 const filename = process.argv[2];
549 for (const spec of queue) {
550 const testFileName = spec.filename;
551 const content = spec.getContent();
552 const meta = spec.meta = this.getMeta(content);
554 const absolutePath = spec.getAbsolutePath();
555 const relativePath = spec.getRelativePath();
556 const harnessPath = fixtures.path('wpt', 'resources', 'testharness.js');
557 const scriptsToRun = [];
562 for (const script of meta.script) {
566 const obj = {
575 const obj = {
589 for (const variant of meta.variant || ['']) {
590 const workerPath = path.join(__dirname, 'wpt/worker.js');
591 const worker = new Worker(workerPath, {
644 for (const spec of this.inProgress) {
657 const failures = [];
660 for (const [key, item] of Object.entries(this.results)) {
672 const unexpectedPasses = [];
673 for (const specMap of queue) {
674 const key = specMap.filename;
700 const ran = queue.length;
701 const total = ran + skipped;
702 const passed = ran - expectedFailures - failures.length;
708 const file = path.join('test', 'wpt', 'status', `${this.path}.json`);
714 const file = path.join('test', 'wpt', 'status', `${this.path}.json`);
723 const spec = this.specMap.get(filename);
750 const status = this.getTestStatus(test.status);
751 const title = this.getTestTitle(filename);
769 const status = this.getTestStatus(harnessStatus.status);
795 const key = item.expected ? 'expected' : 'unexpected';
799 const hasName = result[item.status][key].includes(item.name);
812 const spec = this.specMap.get(filename);
813 const expected = spec.failedTests.includes(test.name);
824 const command = `${process.execPath} ${process.execArgv}` +
839 const title = this.getTestTitle(filename);
841 const joinedReasons = reasons.join('; ');
850 const matches = code.match(/\/\/ META: .+/g);
854 const result = {};
855 for (const match of matches) {
856 const parts = match.match(/\/\/ META: ([^=]+?)=(.+)/);
857 const key = parts[1];
858 const value = parts[2];
873 const queue = [];
874 for (const spec of this.specMap.values()) {
875 const filename = spec.filename;
881 const lackingIntl = intlRequirements.isLacking(spec.requires);