Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
console report spacing and negative array length
Browse files Browse the repository at this point in the history
  • Loading branch information
tabcat committed May 5, 2021
1 parent 129ecac commit 6c7718e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/reporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async function (output, results, baselines) {
}

function consoleReport (results) {
const sp = (n) => new Array(n).fill(' ').join('')
const sp = (n) => new Array(Math.max(0, n)).fill(' ').join('')
const report =
`
benchmarks report:
Expand All @@ -39,7 +39,7 @@ ${benchmarks(results).sort().map(benchmark => [
results[benchmark][env].stats
.map(s => {
const c1 = `${sp(6)}${s[0]}`
const c2 = `${sp(40 - c1.length)}${s[1]}`
const c2 = `${sp(50 - c1.length)}${s[1]}`
const c3 = s[2] ? `${sp(60 - c1.length - c2.length)}${s[2]}` : ''
return c1 + c2 + c3
})
Expand Down

0 comments on commit 6c7718e

Please sign in to comment.