| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ const symbols = { | |||
| 30 | 30 | 'test:pass': '\u2714 ', | |
| 31 | 31 | 'test:diagnostic': '\u2139 ', | |
| 32 | 32 | 'arrow:right': '\u25B6 ', | |
| 33 | + 'hyphen:minus': '\uFE63 ', | ||
| 33 | 34 | }; | |
| 34 | 35 | class SpecReporter extends Transform { | |
| 35 | 36 | #stack = []; | |
@@ -60,8 +61,8 @@ class SpecReporter extends Transform { | |||
| 60 | 61 | return `\n${indent} ${message}\n`; | |
| 61 | 62 | } | |
| 62 | 63 | #handleEvent({ type, data }) { | |
| 63 | - const color = colors[type] ?? white; | ||
| 64 | - const symbol = symbols[type] ?? ' '; | ||
| 64 | + let color = colors[type] ?? white; | ||
| 65 | + let symbol = symbols[type] ?? ' '; | ||
| 65 | 66 | ||
| 66 | 67 | switch (type) { | |
| 67 | 68 | case 'test:fail': | |
@@ -81,15 +82,20 @@ class SpecReporter extends Transform { | |||
| 81 | 82 | ArrayPrototypeUnshift(this.#reported, msg); | |
| 82 | 83 | prefix += `${this.#indent(msg.nesting)}${symbols['arrow:right']}${msg.name}\n`; | |
| 83 | 84 | } | |
| 85 | + const skippedSubtest = subtest && data.skip && data.skip !== undefined; | ||
| 84 | 86 | const indent = this.#indent(data.nesting); | |
| 85 | 87 | const duration_ms = data.details?.duration_ms ? ` ${gray}(${data.details.duration_ms}ms)${white}` : ''; | |
| 86 | - const title = `${data.name}${duration_ms}`; | ||
| 88 | + const title = `${data.name}${duration_ms}${skippedSubtest ? ' # SKIP' : ''}`; | ||
| 87 | 89 | if (this.#reported[0] && this.#reported[0].nesting === data.nesting && this.#reported[0].name === data.name) { | |
| 88 | - // If this test has had children - it was already reporter, so slightly modify the output | ||
| 90 | + // If this test has had children - it was already reported, so slightly modify the output | ||
| 89 | 91 | ArrayPrototypeShift(this.#reported); | |
| 90 | 92 | return `${prefix}${indent}${color}${symbols['arrow:right']}${white}${title}\n\n`; | |
| 91 | 93 | } | |
| 92 | 94 | const error = this.#formatError(data.details?.error, indent); | |
| 95 | + if (skippedSubtest) { | ||
| 96 | + color = gray; | ||
| 97 | + symbol = symbols['hyphen:minus']; | ||
| 98 | + } | ||
| 93 | 99 | return `${prefix}${indent}${color}${symbol}${title}${error}${white}\n`; | |
| 94 | 100 | } | |
| 95 | 101 | case 'test:start': | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,8 @@ | |||
| 20 | 20 | * | |
| 21 | 21 | * | |
| 22 | 22 | ||
| 23 | - sync skip pass (*ms) | ||
| 24 | - sync skip pass with message (*ms) | ||
| 23 | + sync skip pass (*ms) # SKIP | ||
| 24 | + sync skip pass with message (*ms) # SKIP | ||
| 25 | 25 | sync pass (*ms) | |
| 26 | 26 | this test should pass | |
| 27 | 27 | sync throw fail (*ms) | |
@@ -34,7 +34,7 @@ | |||
| 34 | 34 | * | |
| 35 | 35 | * | |
| 36 | 36 | ||
| 37 | - async skip pass (*ms) | ||
| 37 | + async skip pass (*ms) # SKIP | ||
| 38 | 38 | async pass (*ms) | |
| 39 | 39 | async throw fail (*ms) | |
| 40 | 40 | Error: thrown from async throw fail | |
@@ -46,7 +46,7 @@ | |||
| 46 | 46 | * | |
| 47 | 47 | * | |
| 48 | 48 | ||
| 49 | - async skip fail (*ms) | ||
| 49 | + async skip fail (*ms) # SKIP | ||
| 50 | 50 | Error: thrown from async throw fail | |
| 51 | 51 | * | |
| 52 | 52 | * | |
@@ -129,8 +129,8 @@ | |||
| 129 | 129 | top level (*ms) | |
| 130 | 130 | ||
| 131 | 131 | invalid subtest - pass but subtest fails (*ms) | |
| 132 | - sync skip option (*ms) | ||
| 133 | - sync skip option with message (*ms) | ||
| 132 | + sync skip option (*ms) # SKIP | ||
| 133 | + sync skip option with message (*ms) # SKIP | ||
| 134 | 134 | sync skip option is false fail (*ms) | |
| 135 | 135 | Error: this should be executed | |
| 136 | 136 | * | |
@@ -146,13 +146,13 @@ | |||
| 146 | 146 | <anonymous> (*ms) | |
| 147 | 147 | test with only a name provided (*ms) | |
| 148 | 148 | <anonymous> (*ms) | |
| 149 | - <anonymous> (*ms) | ||
| 150 | - test with a name and options provided (*ms) | ||
| 151 | - functionAndOptions (*ms) | ||
| 149 | + <anonymous> (*ms) # SKIP | ||
| 150 | + test with a name and options provided (*ms) # SKIP | ||
| 151 | + functionAndOptions (*ms) # SKIP | ||
| 152 | 152 | escaped description \ # * | |
| 153 | 153 | * | |
| 154 | 154 | (*ms) | |
| 155 | - escaped skip message (*ms) | ||
| 155 | + escaped skip message (*ms) # SKIP | ||
| 156 | 156 | escaped todo message (*ms) | |
| 157 | 157 | escaped diagnostic (*ms) | |
| 158 | 158 | #diagnostic | |
| Back | FazBrowse Home | New Git URL |
0 commit comments