You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom reporters can't access per-attempt details for retries #10303
Custom reporters receive a single TestCase result per test, even when the test ran multiple times via retry. There's no way to access the individual attempts — their status, duration, errors, annotations, or stdio.
Repro: a test with retry: 3 that fails twice then passes — the reporter only sees one result with state: 'passed'.
Suggested solution
It would be useful for Vitest's test result to expose an attempts array with per-attempt details of execution: duration, errors, annotations, stdio, etc.
For reference, Playwright Test exposes this in its reporter API: each retry comes through as a separate TestResult with its own status, duration, errors, attachments, and stdio.
the reporter only sees one result with state: 'passed'.
From diagnostic().retryCount you can see how many times test was retried. So it kind of indicates there were 2x state: 'failed' before the last result.
From diagnostic().retryCount you can see how many times test was retried. So it kind of indicates there were 2x state: 'failed' before the last result.
Activity
AriPerkkio commentedon May 9, 2026
Errors are present in
errors:vitest/packages/vitest/src/node/reporters/reported-tasks.ts
Lines 635 to 640 in ab09822
But I don't think other metrics are stored.
From
diagnostic().retryCountyou can see how many times test was retried. So it kind of indicates there were 2xstate: 'failed'before the last result.aslushnikov commentedon May 9, 2026
Indeed, that's precisely what we do:
https://github.com/flakiness/vitest/blob/c67b1196918a1aed10df1145b6c710732bd48f67/src/reporter.ts#L259-L282
While they are stored there, it's hard to assign them to individual attempts since each attempt might have more than one error.
A contrived example:
sheremet-va commentedon May 10, 2026
I like
attemptsconcept, it could be defined ontask.result, I think. It should also probably includerepeatsruns though.puneetdixit200 commentedon May 16, 2026