| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 904bdf5 commit 288c320
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,10 @@ function formatTestReport(type, data, showErrorDetails = true, prefix = '', inde | |||
| 73 | 73 | let symbol = reporterUnicodeSymbolMap[type] ?? ' '; | |
| 74 | 74 | const { skip, todo, expectFailure } = data; | |
| 75 | 75 | const duration_ms = data.details?.duration_ms ? ` ${colors.gray}(${data.details.duration_ms}ms)${colors.white}` : ''; | |
| 76 | - let title = `${data.name}${duration_ms}`; | ||
| 76 | + const replayed = data.details?.passed_on_attempt !== undefined ? | ||
| 77 | + ` ${colors.gray}(passed on attempt ${data.details.passed_on_attempt})${colors.white}` : | ||
| 78 | + ''; | ||
| 79 | + let title = `${data.name}${duration_ms}${replayed}`; | ||
| 77 | 80 | ||
| 78 | 81 | if (skip !== undefined) { | |
| 79 | 82 | title += ` # ${typeof skip === 'string' && skip.length ? skip : 'SKIP'}`; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,8 +157,15 @@ test('rerun preserves the original duration on the replayed pass', async () => { | |||
| 157 | 157 | const durationFixture = fixtures.path('test-runner', 'rerun-duration.js'); | |
| 158 | 158 | const args = ['--test-rerun-failures', stateFile, durationFixture]; | |
| 159 | 159 | ||
| 160 | - await common.spawnPromisified(process.execPath, args); | ||
| 161 | - await common.spawnPromisified(process.execPath, args); | ||
| 160 | + const first = await common.spawnPromisified(process.execPath, args); | ||
| 161 | + assert.doesNotMatch(first.stdout, /passed on attempt/, | ||
| 162 | + 'no replay marker should appear on the initial run'); | ||
| 163 | + | ||
| 164 | + const second = await common.spawnPromisified(process.execPath, args); | ||
| 165 | + assert.match(second.stdout, /passing slow test[^\n]*\(passed on attempt 0\)/, | ||
| 166 | + 'spec reporter should mark the replayed test on the retry'); | ||
| 167 | + assert.doesNotMatch(second.stdout, /always failing[^\n]*\(passed on attempt/, | ||
| 168 | + 'the failing test must not show the replay marker'); | ||
| 162 | 169 | ||
| 163 | 170 | const raw = JSON.parse(await readFile(stateFile, 'utf8')); | |
| 164 | 171 | const passKey = Object.keys(raw[0]).find((k) => raw[0][k].name === 'passing slow test'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments