kopia lustrzana https://github.com/badgen/badgen
Simplify benchmarks
rodzic
ae09b1be51
commit
1374cbbb51
|
@ -1,12 +1,13 @@
|
|||
const { Suite } = require('benchmark')
|
||||
const badgen = require('..')
|
||||
|
||||
new Suite().add('generate by short params', function () {
|
||||
badgen({ subject: 'b', status: 'p' })
|
||||
}).add('generate by long params ', function () {
|
||||
badgen({ subject: 'build-build-build', status: 'passing-passing-passing' })
|
||||
}).add('generate by full params ', function () {
|
||||
badgen({ subject: 'license', status: 'Apache-2.0', color: 'blue' })
|
||||
}).on('cycle', function (event) {
|
||||
console.log(String(event.target))
|
||||
}).run()
|
||||
const shortParams = { subject: 'b', status: 'p' }
|
||||
const longParams = { subject: 'build-build-build', status: 'passing-passing-passing' }
|
||||
const fullParams = { subject: 'license', status: 'Apache-2.0', color: 'blue' }
|
||||
|
||||
new Suite()
|
||||
.add('generate by short params', () => badgen(shortParams))
|
||||
.add('generate by long params ', () => badgen(longParams))
|
||||
.add('generate by full params ', () => badgen(fullParams))
|
||||
.on('cycle', event => console.log(String(event.target)))
|
||||
.run()
|
||||
|
|
Ładowanie…
Reference in New Issue