badgen/bench/index.js

16 wiersze
782 B
JavaScript
Czysty Zwykły widok Historia

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-19 03:19:09 +00:00
const fullParams = { subject: 'license', status: 'Apache 2.0', color: 'cyan' }
2018-07-19 06:24:52 +00:00
const emojiParams = { subject: 'emojis', status: '💩🤱🦄💩🤱🦄', emoji: true }
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))
.add(' [flat] style, long params ', () => badgen({ style: 'flat', ...longParams }))
.add(' [flat] style, full params ', () => badgen({ style: 'flat', ...fullParams }))
2018-07-19 03:19:09 +00:00
.add('[classic] style, emoji params', () => badgen(emojiParams))
2018-06-23 09:59:12 +00:00
.on('cycle', event => console.log(String(event.target)))
.run()