| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9d4d916 commit 4b7198c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,7 +138,7 @@ function setup(root) { | |||
| 138 | 138 | createProcessEventHandler('unhandledRejection', root); | |
| 139 | 139 | const coverage = configureCoverage(root, globalOptions); | |
| 140 | 140 | const exitHandler = () => { | |
| 141 | - root.coverage = collectCoverage(root, coverage); | ||
| 141 | + root.harness.coverage = collectCoverage(root, coverage); | ||
| 142 | 142 | root.postRun(new ERR_TEST_FAILURE( | |
| 143 | 143 | 'Promise resolution is still pending but the event loop has already resolved', | |
| 144 | 144 | kCancelledByParent)); | |
@@ -162,6 +162,11 @@ function setup(root) { | |||
| 162 | 162 | process.on('SIGTERM', terminationHandler); | |
| 163 | 163 | } | |
| 164 | 164 | ||
| 165 | + root.harness = { | ||
| 166 | + __proto__: null, | ||
| 167 | + bootstrapComplete: false, | ||
| 168 | + coverage: null, | ||
| 169 | + }; | ||
| 165 | 170 | root.startTime = hrtime(); | |
| 166 | 171 | ||
| 167 | 172 | wasRootSetup.add(root); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -251,7 +251,7 @@ class Test extends AsyncResource { | |||
| 251 | 251 | this.#outerSignal?.addEventListener('abort', this.#abortHandler); | |
| 252 | 252 | ||
| 253 | 253 | this.fn = fn; | |
| 254 | - this.coverage = null; // Configured on the root test by the test harness. | ||
| 254 | + this.harness = null; // Configured on the root test by the test harness. | ||
| 255 | 255 | this.mock = null; | |
| 256 | 256 | this.name = name; | |
| 257 | 257 | this.parent = parent; | |
@@ -637,8 +637,8 @@ class Test extends AsyncResource { | |||
| 637 | 637 | this.reporter.diagnostic(this.nesting, kFilename, `todo ${counters.todo}`); | |
| 638 | 638 | this.reporter.diagnostic(this.nesting, kFilename, `duration_ms ${this.#duration()}`); | |
| 639 | 639 | ||
| 640 | - if (this.coverage) { | ||
| 641 | - this.reporter.coverage(this.nesting, kFilename, this.coverage); | ||
| 640 | + if (this.harness?.coverage) { | ||
| 641 | + this.reporter.coverage(this.nesting, kFilename, this.harness.coverage); | ||
| 642 | 642 | } | |
| 643 | 643 | ||
| 644 | 644 | this.reporter.push(null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments