// Node can look at the filesystem, but JS in the browser can't. // This crawls the file tree under src/suites/${suite} to generate a (non-hierarchical) static // listing file that can then be used in the browser to load the modules containing the tests.
import * as fs from 'fs'; import * as path from 'path';
import { loadMetadataForSuite } from '../framework/metadata.js'; import { SpecFile } from '../internal/file_loader.js'; import { TestQueryMultiCase, TestQueryMultiFile } from '../internal/query/query.js'; import { validQueryPart } from '../internal/query/validQueryPart.js'; import { TestSuiteListingEntry, TestSuiteListing } from '../internal/test_suite_listing.js'; import { assert, unreachable } from '../util/util.js';
if (validateTimingsEntries) { const zeroEntries = []; const staleEntries = []; for (const [metadataKey, metadataValue] of Object.entries(validateTimingsEntries.metadata)) { if (metadataKey.startsWith('_')) { // Ignore json "_comments". continue;
} if (metadataValue.subcaseMS <= 0) {
zeroEntries.push(metadataKey);
} if (!validateTimingsEntries.testsFoundInFiles.has(metadataKey)) {
staleEntries.push(metadataKey);
}
} if (zeroEntries.length && opts?.printMetadataWarnings) {
console.warn( 'WARNING: subcaseMS ≤ 0 found in listing_meta.json (see docs/adding_timing_metadata.md):'
); for (const metadataKey of zeroEntries) {
console.warn(` ${metadataKey}`);
}
}
if (opts?.printMetadataWarnings) { const missingEntries = []; for (const metadataKey of validateTimingsEntries.testsFoundInFiles) { if (!(metadataKey in validateTimingsEntries.metadata)) {
missingEntries.push(metadataKey);
}
} if (missingEntries.length) {
console.error( 'WARNING: Tests missing from listing_meta.json (see docs/adding_timing_metadata.md):'
); for (const metadataKey of missingEntries) {
console.error(` ${metadataKey}`);
}
}
}
if (staleEntries.length) {
console.error('ERROR: Non-existent tests found in listing_meta.json. Please update:'); for (const metadataKey of staleEntries) {
console.error(` ${metadataKey}`);
}
unreachable();
}
}
return entries;
}
export function makeListing(filename: string): Promise<TestSuiteListing> { // Don't validate. This path is only used for the dev server and running tests with Node. // Validation is done for listing generation and presubmit. return crawl(path.dirname(filename));
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-04)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.