extra tests, specific benchmark, example in readme

This commit is contained in:
Toon Baeyens 2020-05-06 15:24:58 +02:00
parent 7d238e2ebb
commit e5ea8df1e5
5 changed files with 26 additions and 2 deletions

View file

@ -47,4 +47,16 @@ suite('chalk', () => {
bench('cached: 1 style nested non-intersecting', () => {
chalkBgRed(blueStyledString);
});
set('iterations', 10000);
bench('cached: 1 style template literal', () => {
// eslint-disable-next-line no-unused-expressions
chalkRed`the fox jumps over the lazy dog`;
});
bench('cached: nested styles template literal', () => {
// eslint-disable-next-line no-unused-expressions
chalkRed`the fox {bold jumps} over the {underline lazy} dog`;
});
});