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

Function lazyBootstrapRoot

lib/internal/test_runner/harness.js:339–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337}
338
339function lazyBootstrapRoot() {
340 if (!globalRoot) {
341 // This is where the test runner is bootstrapped when node:test is used
342 // without the --test flag or the run() API.
343 const entryFile = process.argv?.[1];
344 const rootTestOptions = {
345 __proto__: null,
346 entryFile,
347 loc: entryFile ? [1, 1, entryFile] : undefined,
348 };
349 const globalOptions = parseCommandLine();
350 globalOptions.cwd = process.cwd();
351 createTestTree(rootTestOptions, globalOptions);
352 globalRoot.reporter.on('test:summary', (data) => {
353 if (!data.success) {
354 process.exitCode = kGenericUserError;
355 }
356 });
357 globalRoot.harness.bootstrapPromise = SafePromiseAllReturnVoid([
358 globalRoot.harness.bootstrapPromise,
359 globalOptions.setup(globalRoot.reporter),
360 ]);
361 }
362 return globalRoot;
363}
364
365async function startSubtestAfterBootstrap(subtest) {
366 if (subtest.root.harness.buildPromise) {

Callers 2

runFunction · 0.85
hookFunction · 0.85

Calls 4

createTestTreeFunction · 0.85
parseCommandLineFunction · 0.70
onMethod · 0.45
setupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…