Support template literals for nested calls (#392)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
Toon Baeyens 2020-06-09 09:36:34 +02:00 committed by GitHub
parent 55816cdd4d
commit 09ddbadcb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 61 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`;
});
});