2014-07-04 22:29:02 +02:00
|
|
|
var chalk = require('./');
|
2014-07-04 21:21:44 +02:00
|
|
|
|
2014-07-04 22:29:02 +02:00
|
|
|
suite('chalk', function () {
|
2014-07-04 22:32:23 +02:00
|
|
|
set('iterations', 100000);
|
|
|
|
|
|
2014-07-04 22:29:02 +02:00
|
|
|
bench('single style', function () {
|
2014-07-04 21:21:44 +02:00
|
|
|
chalk.red('the fox jumps over the lazy dog');
|
|
|
|
|
});
|
|
|
|
|
|
2014-07-04 22:29:02 +02:00
|
|
|
bench('several styles', function () {
|
|
|
|
|
chalk.blue.bgRed.bold('the fox jumps over the lazy dog');
|
2014-07-04 21:21:44 +02:00
|
|
|
});
|
|
|
|
|
|
2014-07-08 20:43:54 -07:00
|
|
|
var cached = chalk.blue.bgRed.bold;
|
|
|
|
|
bench('cached styles', function () {
|
|
|
|
|
cached('the fox jumps over the lazy dog');
|
|
|
|
|
});
|
|
|
|
|
|
2014-07-04 22:29:02 +02:00
|
|
|
bench('nested styles', function () {
|
|
|
|
|
chalk.red('the fox jumps', chalk.underline.bgBlue('over the lazy dog') + '!');
|
2014-07-04 21:21:44 +02:00
|
|
|
});
|
|
|
|
|
});
|