Skip to content

Commit

Permalink
chore: tweak line
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 4, 2024
1 parent cc25eac commit 564062e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vitest/src/node/reporters/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down
2 changes: 2 additions & 0 deletions test/benchmark/test/__snapshots__/reporter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
"
`;

0 comments on commit 564062e

Please sign in to comment.