| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6535ab9 commit 882c612
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const { | |
| 3 | 3 | ArrayPrototypeForEach, | |
| 4 | + FunctionPrototypeBind, | ||
| 4 | 5 | PromiseResolve, | |
| 5 | 6 | SafeMap, | |
| 6 | 7 | } = primordials; | |
@@ -138,7 +139,6 @@ function setup(root) { | |||
| 138 | 139 | createProcessEventHandler('unhandledRejection', root); | |
| 139 | 140 | const coverage = configureCoverage(root, globalOptions); | |
| 140 | 141 | const exitHandler = () => { | |
| 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)); | |
@@ -165,7 +165,7 @@ function setup(root) { | |||
| 165 | 165 | root.harness = { | |
| 166 | 166 | __proto__: null, | |
| 167 | 167 | bootstrapComplete: false, | |
| 168 | - coverage: null, | ||
| 168 | + coverage: FunctionPrototypeBind(collectCoverage, null, root, coverage), | ||
| 169 | 169 | counters: { | |
| 170 | 170 | __proto__: null, | |
| 171 | 171 | all: 0, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -644,8 +644,10 @@ class Test extends AsyncResource { | |||
| 644 | 644 | this.reporter.diagnostic(this.nesting, kFilename, `todo ${this.root.harness.counters.todo}`); | |
| 645 | 645 | this.reporter.diagnostic(this.nesting, kFilename, `duration_ms ${this.#duration()}`); | |
| 646 | 646 | ||
| 647 | - if (this.harness?.coverage) { | ||
| 648 | - this.reporter.coverage(this.nesting, kFilename, this.harness.coverage); | ||
| 647 | + const coverage = this.harness.coverage(); | ||
| 648 | + | ||
| 649 | + if (coverage) { | ||
| 650 | + this.reporter.coverage(this.nesting, kFilename, coverage); | ||
| 649 | 651 | } | |
| 650 | 652 | ||
| 651 | 653 | this.reporter.push(null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments