diff --git a/packages/vitest/src/node/reporters/base.ts b/packages/vitest/src/node/reporters/base.ts index d73863853ca8..f1b149b76378 100644 --- a/packages/vitest/src/node/reporters/base.ts +++ b/packages/vitest/src/node/reporters/base.ts @@ -330,8 +330,10 @@ export abstract class BaseReporter implements Reporter { const siblings = group.tasks .filter(i => i.meta.benchmark && i.result?.benchmark && i !== bench) .sort((a, b) => a.result!.benchmark!.rank - b.result!.benchmark!.rank) - if (siblings.length === 0) + if (siblings.length === 0) { + logger.log('') continue + } for (const sibling of siblings) { const number = `${(sibling.result!.benchmark!.mean / bench.result!.benchmark!.mean).toFixed(2)}x` logger.log(` ${c.green(number)} ${c.gray('faster than')} ${sibling.name}`) diff --git a/test/benchmark/test/__snapshots__/reporter.test.ts.snap b/test/benchmark/test/__snapshots__/reporter.test.ts.snap index b63c951628fa..74cc103fe6e4 100644 --- a/test/benchmark/test/__snapshots__/reporter.test.ts.snap +++ b/test/benchmark/test/__snapshots__/reporter.test.ts.snap @@ -7,6 +7,8 @@ exports[`summary 1`] = ` ?.??x faster than bad good - summary.bench.ts > suite-b + good - summary.bench.ts > suite-b > suite-b-nested + " `;