From a37d82bc1d6472a50d5a62e1cca2a96992c92a58 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Thu, 28 Apr 2022 16:16:37 +0300 Subject: [PATCH] fix: clear errors before running files --- packages/vitest/src/node/core.ts | 1 + packages/vitest/src/node/reporters/base.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vitest/src/node/core.ts b/packages/vitest/src/node/core.ts index 96463c7455fe..bc38c4e706d0 100644 --- a/packages/vitest/src/node/core.ts +++ b/packages/vitest/src/node/core.ts @@ -226,6 +226,7 @@ export class Vitest { const invalidates = Array.from(this.invalidates) this.invalidates.clear() this.snapshot.clear() + this.state.clearErrors() try { await this.pool.runTests(files, invalidates) } diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index 0560c907e1da..0d2e7373a4a2 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -122,7 +122,6 @@ export abstract class BaseReporter implements Reporter { async onWatcherRerun(files: string[], trigger?: string) { this.watchFilters = files - this.ctx.state.clearErrors() this.ctx.clearScreen() this.ctx.log(`\n${c.inverse(c.bold(c.blue(' RERUN ')))}${trigger ? c.dim(` ${this.relative(trigger)}\n`) : ''}`) this.start = performance.now()