diff --git a/packages/vitest/src/runtime/runner/run.ts b/packages/vitest/src/runtime/runner/run.ts index 8baf1543a..b0b58a6b0 100644 --- a/packages/vitest/src/runtime/runner/run.ts +++ b/packages/vitest/src/runtime/runner/run.ts @@ -618,6 +618,7 @@ async function runTest(test: Test, runner: VitestRunner): Promise { const repeats = test.repeats ?? 0 let failedRepeatErrors: TestError[] | undefined for (let repeatCount = 0; repeatCount <= repeats; repeatCount++) { + // TypeScript cannot track state mutations made by hooks and the test. test.result.state = 'run' as TaskState test.result.errors = undefined const retry = getRetryCount(test.retry)