diff --git a/packages/vitest/src/node/reporters/reported-tasks.ts b/packages/vitest/src/node/reporters/reported-tasks.ts index e35b53d2a..260d8fcc2 100644 --- a/packages/vitest/src/node/reporters/reported-tasks.ts +++ b/packages/vitest/src/node/reporters/reported-tasks.ts @@ -623,7 +623,8 @@ function buildOptions(task: RunnerTestCase | RunnerTestSuite): TaskOptions { } } -export type TestSuiteState = 'skipped' | 'pending' | 'failed' | 'passed' +export type TestAttemptState = 'skipped' | 'failed' | 'passed' +export type TestSuiteState = TestAttemptState | 'pending' export type TestModuleState = TestSuiteState | 'queued' export type TestState = TestResult['state'] @@ -632,7 +633,7 @@ export type TestState = TestResult['state'] */ export interface TestAttempt { /** The state after applying the test's expected failure option. */ - readonly state: 'passed' | 'failed' | 'skipped' + readonly state: TestAttemptState /** Errors produced by this attempt. */ readonly errors: ReadonlyArray | undefined /** How long in milliseconds the attempt took to run. */ diff --git a/packages/vitest/src/public/node.ts b/packages/vitest/src/public/node.ts index ea654dfb0..4a366d3a4 100644 --- a/packages/vitest/src/public/node.ts +++ b/packages/vitest/src/public/node.ts @@ -81,6 +81,7 @@ export type { ModuleDiagnostic, TaskOptions, TestAttempt, + TestAttemptState, TestCase, TestCollection, TestDiagnostic,