2018-06-23 09:54:52 +00:00
|
|
|
const { Suite } = require('benchmark')
|
|
|
|
const badgen = require('..')
|
|
|
|
|
2018-06-23 09:59:12 +00:00
|
|
|
const longParams = { subject: 'build-build-build', status: 'passing-passing-passing' }
|
2018-07-01 06:53:52 +00:00
|
|
|
const fullParams = { subject: 'license', status: 'MIT', color: 'cyan' }
|
2018-07-18 16:34:21 +00:00
|
|
|
const emojiParams = { subject: 'emojis', status: '💩🤱🦄', color: 'cyan' }
|
2018-06-23 09:59:12 +00:00
|
|
|
|
|
|
|
new Suite()
|
2018-07-15 09:22:56 +00:00
|
|
|
.add('[classic] style, long params ', () => badgen(longParams))
|
|
|
|
.add('[classic] style, full params ', () => badgen(fullParams))
|
2018-07-18 05:54:25 +00:00
|
|
|
.add(' [flat] style, long params ', () => badgen({ style: 'flat', ...longParams }))
|
|
|
|
.add(' [flat] style, full params ', () => badgen({ style: 'flat', ...fullParams }))
|
2018-07-18 09:58:04 +00:00
|
|
|
.add('[classic] style, multi bytes ', () => badgen(emojiParams))
|
2018-06-23 09:59:12 +00:00
|
|
|
.on('cycle', event => console.log(String(event.target)))
|
|
|
|
.run()
|