| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 77e2bf0 commit e2ae436
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,7 @@ const { | |||
| 26 | 26 | setupTestReporters, | |
| 27 | 27 | shouldColorizeTestFiles, | |
| 28 | 28 | } = require('internal/test_runner/utils'); | |
| 29 | + const { queueMicrotask } = require('internal/process/task_queues'); | ||
| 29 | 30 | const { bigint: hrtime } = process.hrtime; | |
| 30 | 31 | ||
| 31 | 32 | const testResources = new SafeMap(); | |
@@ -189,6 +190,7 @@ function setup(root) { | |||
| 189 | 190 | ||
| 190 | 191 | root.harness = { | |
| 191 | 192 | __proto__: null, | |
| 193 | + allowTestsToRun: false, | ||
| 192 | 194 | bootstrapComplete: false, | |
| 193 | 195 | watching: false, | |
| 194 | 196 | coverage: FunctionPrototypeBind(collectCoverage, null, root, coverage), | |
@@ -232,7 +234,16 @@ function getGlobalRoot() { | |||
| 232 | 234 | ||
| 233 | 235 | async function startSubtest(subtest) { | |
| 234 | 236 | await reportersSetup; | |
| 235 | - getGlobalRoot().harness.bootstrapComplete = true; | ||
| 237 | + | ||
| 238 | + const root = getGlobalRoot(); | ||
| 239 | + if (!root.harness.bootstrapComplete) { | ||
| 240 | + root.harness.bootstrapComplete = true; | ||
| 241 | + queueMicrotask(() => { | ||
| 242 | + root.harness.allowTestsToRun = true; | ||
| 243 | + root.processPendingSubtests(); | ||
| 244 | + }); | ||
| 245 | + } | ||
| 246 | + | ||
| 236 | 247 | await subtest.start(); | |
| 237 | 248 | } | |
| 238 | 249 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -590,6 +590,7 @@ function run(options) { | |||
| 590 | 590 | } | |
| 591 | 591 | const runFiles = () => { | |
| 592 | 592 | root.harness.bootstrapComplete = true; | |
| 593 | + root.harness.allowTestsToRun = true; | ||
| 593 | 594 | return SafePromiseAllSettledReturnVoid(testFiles, (path) => { | |
| 594 | 595 | const subtest = runTestFile(path, filesWatcher, opts); | |
| 595 | 596 | filesWatcher?.runningSubtests.set(path, subtest); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -584,7 +584,7 @@ class Test extends AsyncResource { | |||
| 584 | 584 | // it. Otherwise, return a Promise to the caller and mark the test as | |
| 585 | 585 | // pending for later execution. | |
| 586 | 586 | this.reporter.enqueue(this.nesting, this.loc, this.name); | |
| 587 | - if (!this.parent.hasConcurrency()) { | ||
| 587 | + if (!this.root.harness.allowTestsToRun || !this.parent.hasConcurrency()) { | ||
| 588 | 588 | const deferred = createDeferredPromise(); | |
| 589 | 589 | ||
| 590 | 590 | deferred.test = this; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,9 @@ not ok 1 - fails | |||
| 21 | 21 | * | |
| 22 | 22 | * | |
| 23 | 23 | * | |
| 24 | + * | ||
| 25 | + * | ||
| 26 | + * | ||
| 24 | 27 | ... | |
| 25 | 28 | 1..1 | |
| 26 | 29 | # tests 1 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments