Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/runner/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ export async function runTest(test: Test, runner: VitestRunner): Promise<void> {
})

if (test.result!.state !== 'fail') {
if (!test.repeats) {
if (!test.repeats || repeatCount === repeats) {
test.result!.state = 'pass'
}
else if (test.repeats && retry === retryCount) {
Expand Down
3 changes: 3 additions & 0 deletions test/cli/fixtures/reported-tasks/1_first.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ it('registers a metadata', (ctx) => {
ctx.task.meta.key = 'value'
})

it('should not show up as pending test when finished (#9689)', { retry: 1, repeats: 1 }, () => {})
Comment thread
AriPerkkio marked this conversation as resolved.
Outdated


declare module 'vitest' {
interface TaskMeta {
key?: string
Expand Down
8 changes: 4 additions & 4 deletions test/cli/test/reported-tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ it('correctly reports a file', ({ testModule, files, project }) => {
expect(testModule.location).toBeUndefined()
expect(testModule.moduleId).toBe(resolve(root, './1_first.test.ts'))
expect(testModule.project).toBe(project)
expect(testModule.children.size).toBe(17)
expect(testModule.children.size).toBe(18)

const tests = [...testModule.children.tests()]
expect(tests).toHaveLength(12)
expect(tests).toHaveLength(13)
const deepTests = [...testModule.children.allTests()]
expect(deepTests).toHaveLength(22)
expect(deepTests).toHaveLength(23)

expect.soft([...testModule.children.allTests('skipped')]).toHaveLength(8)
expect.soft([...testModule.children.allTests('passed')]).toHaveLength(9)
expect.soft([...testModule.children.allTests('passed')]).toHaveLength(10)
expect.soft([...testModule.children.allTests('failed')]).toHaveLength(5)
expect.soft([...testModule.children.allTests('pending')]).toHaveLength(0)

Expand Down
Loading