chore: add bench for icon support

pull/6/head
Amio 2018-07-20 15:51:00 +08:00
rodzic b11372f5dd
commit 377673a1cb
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -1,15 +1,18 @@
const { Suite } = require('benchmark')
const badgen = require('..')
const dockerIcon = require('../test/docker-icon-b64.js')
const longParams = { subject: 'build-build-build', status: 'passing-passing-passing' }
const fullParams = { subject: 'license', status: 'Apache 2.0', color: 'cyan' }
const emojiParams = { subject: 'emojis', status: '💩🤱🦄💩🤱🦄', emoji: true }
const iconParams = { subject: 'docker', status: 'badge', icon: dockerIcon }
new Suite()
.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 }))
.add('[classic] style, emoji params', () => badgen(emojiParams))
.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 }))
.add('[classic] style, with emoji ', () => badgen(emojiParams))
.add('[classic] style, with icon ', () => badgen(iconParams))
.on('cycle', event => console.log(String(event.target)))
.run()