Skip to content

Commit

Permalink
Fixing repeat suite logic
Browse files Browse the repository at this point in the history
  • Loading branch information
samkevin1 committed Mar 7, 2023
1 parent 7bc7d52 commit 47ff3d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/runner/src/run.ts
Expand Up @@ -246,11 +246,9 @@ export async function runSuite(suite: Suite, runner: VitestRunner) {
suite.result.state = 'todo'
}
else {
let retry = suite.repeats
const retry = suite.mode === 'repeats' ? suite.repeats! : suite.retry || 1

for (let retryCount = 0; retryCount < retry!; retryCount++) {
if (suite.mode !== 'repeats')
retry = 1
for (let retryCount = 0; retryCount < retry; retryCount++) {
try {
beforeAllCleanups = await callSuiteHook(suite, suite, 'beforeAll', runner, [suite])

Expand Down
Expand Up @@ -107,7 +107,7 @@ export function renderTree(tasks: Task[], options: ListRendererOptions, level =
if (task.mode === 'skip' || task.mode === 'todo')
suffix += ` ${c.dim(c.gray('[skipped]'))}`

if (task.mode === 'repeats')
if (task.type === 'suite' && task.tasks.find(t => t.mode === 'repeats'))
suffix += ` ${c.dim(c.gray('[repeated]'))}`

if (task.result?.duration != null) {
Expand Down

0 comments on commit 47ff3d5

Please sign in to comment.