()
| 337 | } |
| 338 | |
| 339 | function 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 | |
| 365 | async function startSubtestAfterBootstrap(subtest) { |
| 366 | if (subtest.root.harness.buildPromise) { |
no test coverage detected
searching dependent graphs…