From 4a4476251a7e1b1e924b4cee60a660f23f7ada80 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Mon, 23 Feb 2026 04:04:53 +0100 Subject: [PATCH] fix(reporters): prevent yellow dots in dot reporter when all tests pass (fix #9681) --- packages/vitest/src/node/reporters/dot.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/vitest/src/node/reporters/dot.ts b/packages/vitest/src/node/reporters/dot.ts index 6a819e333320..4a1e0fc505db 100644 --- a/packages/vitest/src/node/reporters/dot.ts +++ b/packages/vitest/src/node/reporters/dot.ts @@ -45,6 +45,7 @@ export class DotReporter extends BaseReporter { onWatcherRerun(files: string[], trigger?: string): void { this.tests.clear() + this.finishedTests.clear() this.renderer?.start() super.onWatcherRerun(files, trigger) } @@ -111,7 +112,7 @@ export class DotReporter extends BaseReporter { return } - const finishedTests = Array.from(this.tests).filter(entry => entry[1] !== 'pending') + const finishedTests = Array.from(this.tests).filter(([id]) => this.finishedTests.has(id)) if (finishedTests.length < columns) { return @@ -178,14 +179,18 @@ function formatTests(states: TestCaseState[]): string { continue } - output += currentIcon.color(currentIcon.char.repeat(count)) + if (count > 0) { + output += currentIcon.color(currentIcon.char.repeat(count)) + } // Start tracking new group count = 1 currentIcon = icon } - output += currentIcon.color(currentIcon.char.repeat(count)) + if (count > 0) { + output += currentIcon.color(currentIcon.char.repeat(count)) + } return output }