Fixing some of requested changes for pull request

This commit is contained in:
Felipe 2018-02-16 01:26:53 -02:00
parent 4c26f9128d
commit eb2565ce3d
6 changed files with 63 additions and 23 deletions

View file

@ -21,4 +21,28 @@ suite('chalk', () => {
bench('nested styles', () => {
chalk.red('the fox jumps', chalk.underline.bgBlue('over the lazy dog') + '!');
});
const wrappedChalk = new chalk.constructor({
wrapper: {
before: '@',
after: '#'
}
});
bench('wrapped single style', () => {
wrappedChalk.red('the fox jumps');
});
bench('wrapped several styles', () => {
wrappedChalk.blue.bgRed.bold('the fox jumps over the lazy dog');
});
const cachedWrapper = wrappedChalk.blue.bgRed.bold;
bench('cached wrapped styles', () => {
cachedWrapper('the fox jumps over the lazy dog');
});
bench('nested wrapped styles', () => {
wrappedChalk.red('the fox jumps', wrappedChalk.underline.bgBlue('over the lazy dog') + '!');
});
});