Simplify benchmarks

pull/3/head
Amio 2018-06-23 17:59:12 +08:00
rodzic ae09b1be51
commit 1374cbbb51
1 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -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()