| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b832d77 commit 7960ccb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ const { exitCodes: { kGenericUserError } } = internalBinding('errors'); | |||
| 18 | 18 | const { kEmptyObject } = require('internal/util'); | |
| 19 | 19 | const { kCancelledByParent, Test, Suite } = require('internal/test_runner/test'); | |
| 20 | 20 | const { | |
| 21 | - kAsyncBootstrapFailure, | ||
| 22 | 21 | parseCommandLine, | |
| 23 | 22 | setupTestReporters, | |
| 24 | 23 | } = require('internal/test_runner/utils'); | |
@@ -32,11 +31,11 @@ function createTestTree(options = kEmptyObject) { | |||
| 32 | 31 | ||
| 33 | 32 | function createProcessEventHandler(eventName, rootTest) { | |
| 34 | 33 | return (err) => { | |
| 35 | - if (err?.failureType === kAsyncBootstrapFailure) { | ||
| 34 | + if (!rootTest.harness.bootstrapComplete) { | ||
| 36 | 35 | // Something went wrong during the asynchronous portion of bootstrapping | |
| 37 | 36 | // the test runner. Since the test runner is not setup properly, we can't | |
| 38 | 37 | // do anything but throw the error. | |
| 39 | - throw err.cause; | ||
| 38 | + throw err; | ||
| 40 | 39 | } | |
| 41 | 40 | ||
| 42 | 41 | // Check if this error is coming from a test. If it is, fail the test. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,6 @@ const { | |||
| 7 | 7 | RegExp, | |
| 8 | 8 | RegExpPrototypeExec, | |
| 9 | 9 | SafeMap, | |
| 10 | - Symbol, | ||
| 11 | 10 | } = primordials; | |
| 12 | 11 | const { basename } = require('path'); | |
| 13 | 12 | const { createWriteStream } = require('fs'); | |
@@ -24,7 +23,6 @@ const { | |||
| 24 | 23 | } = require('internal/errors'); | |
| 25 | 24 | const { compose } = require('stream'); | |
| 26 | 25 | ||
| 27 | - const kAsyncBootstrapFailure = Symbol('asyncBootstrapFailure'); | ||
| 28 | 26 | const kMultipleCallbackInvocations = 'multipleCallbackInvocations'; | |
| 29 | 27 | const kRegExpPattern = /^\/(.*)\/([a-z]*)$/; | |
| 30 | 28 | const kSupportedFileExtensions = /\.[cm]?js$/; | |
@@ -151,15 +149,11 @@ async function getReportersMap(reporters, destinations) { | |||
| 151 | 149 | ||
| 152 | 150 | ||
| 153 | 151 | async function setupTestReporters(rootTest) { | |
| 154 | - try { | ||
| 155 | - const { reporters, destinations } = parseCommandLine(); | ||
| 156 | - const reportersMap = await getReportersMap(reporters, destinations); | ||
| 157 | - for (let i = 0; i < reportersMap.length; i++) { | ||
| 158 | - const { reporter, destination } = reportersMap[i]; | ||
| 159 | - compose(rootTest.reporter, reporter).pipe(destination); | ||
| 160 | - } | ||
| 161 | - } catch (err) { | ||
| 162 | - throw new ERR_TEST_FAILURE(err, kAsyncBootstrapFailure); | ||
| 152 | + const { reporters, destinations } = parseCommandLine(); | ||
| 153 | + const reportersMap = await getReportersMap(reporters, destinations); | ||
| 154 | + for (let i = 0; i < reportersMap.length; i++) { | ||
| 155 | + const { reporter, destination } = reportersMap[i]; | ||
| 156 | + compose(rootTest.reporter, reporter).pipe(destination); | ||
| 163 | 157 | } | |
| 164 | 158 | } | |
| 165 | 159 | ||
@@ -225,7 +219,6 @@ module.exports = { | |||
| 225 | 219 | doesPathMatchFilter, | |
| 226 | 220 | isSupportedFileType, | |
| 227 | 221 | isTestFailureError, | |
| 228 | - kAsyncBootstrapFailure, | ||
| 229 | 222 | parseCommandLine, | |
| 230 | 223 | setupTestReporters, | |
| 231 | 224 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments