From 377673a1cb771116c24913122a236204b603b43f Mon Sep 17 00:00:00 2001 From: Amio Date: Fri, 20 Jul 2018 15:51:00 +0800 Subject: [PATCH] chore: add bench for icon support --- bench/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bench/index.js b/bench/index.js index 1d9cae4..04f4efa 100644 --- a/bench/index.js +++ b/bench/index.js @@ -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()