| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4f30c21 commit a5a4c3e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ class SpecReporter extends Transform { | |||
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | 55 | this.#failedTests = []; // Clean up the failed tests | |
| 56 | - return ArrayPrototypeJoin(results, '\n'); ; | ||
| 56 | + return ArrayPrototypeJoin(results, '\n'); | ||
| 57 | 57 | } | |
| 58 | 58 | #handleTestReportEvent(type, data) { | |
| 59 | 59 | const subtest = ArrayPrototypeShift(this.#stack); // This is the matching `test:start` event | |
@@ -71,13 +71,8 @@ class SpecReporter extends Transform { | |||
| 71 | 71 | ArrayPrototypeUnshift(this.#reported, msg); | |
| 72 | 72 | prefix += `${indent(msg.nesting)}${reporterUnicodeSymbolMap['arrow:right']}${msg.name}\n`; | |
| 73 | 73 | } | |
| 74 | - let hasChildren = false; | ||
| 75 | - if (this.#reported[0] && this.#reported[0].nesting === data.nesting && this.#reported[0].name === data.name) { | ||
| 76 | - ArrayPrototypeShift(this.#reported); | ||
| 77 | - hasChildren = true; | ||
| 78 | - } | ||
| 79 | 74 | const indentation = indent(data.nesting); | |
| 80 | - return `${formatTestReport(type, data, prefix, indentation, hasChildren, false)}\n`; | ||
| 75 | + return `${formatTestReport(type, data, false, prefix, indentation)}\n`; | ||
| 81 | 76 | } | |
| 82 | 77 | #handleEvent({ type, data }) { | |
| 83 | 78 | switch (type) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,6 @@ function indent(nesting) { | |||
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | function formatError(error, indent) { | |
| 61 | - if (!error) return ''; | ||
| 62 | 61 | const err = error.code === 'ERR_TEST_FAILURE' ? error.cause : error; | |
| 63 | 62 | const message = ArrayPrototypeJoin( | |
| 64 | 63 | RegExpPrototypeSymbolSplit( | |
@@ -68,7 +67,7 @@ function formatError(error, indent) { | |||
| 68 | 67 | return `\n${indent} ${message}\n`; | |
| 69 | 68 | } | |
| 70 | 69 | ||
| 71 | - function formatTestReport(type, data, prefix = '', indent = '', hasChildren = false, showErrorDetails = true) { | ||
| 70 | + function formatTestReport(type, data, showErrorDetails = true, prefix = '', indent = '') { | ||
| 72 | 71 | let color = reporterColorMap[type] ?? colors.white; | |
| 73 | 72 | let symbol = reporterUnicodeSymbolMap[type] ?? ' '; | |
| 74 | 73 | const { skip, todo, expectFailure } = data; | |
@@ -83,10 +82,7 @@ function formatTestReport(type, data, prefix = '', indent = '', hasChildren = fa | |||
| 83 | 82 | title += ` # EXPECTED FAILURE`; | |
| 84 | 83 | } | |
| 85 | 84 | ||
| 86 | - const error = showErrorDetails ? formatError(data.details?.error, indent) : ''; | ||
| 87 | - const err = hasChildren ? | ||
| 88 | - (!error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`) : | ||
| 89 | - error; | ||
| 85 | + const err = showErrorDetails && data.details?.error ? formatError(data.details.error, indent) : ''; | ||
| 90 | 86 | ||
| 91 | 87 | if (skip !== undefined) { | |
| 92 | 88 | color = colors.gray; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments