don't output escape codes if the input is empty
This commit is contained in:
parent
879defda72
commit
492d63916c
2 changed files with 5 additions and 1 deletions
4
test.js
4
test.js
|
|
@ -37,6 +37,10 @@ describe('chalk', function () {
|
|||
it('should support falsy values', function () {
|
||||
assert.equal(chalk.red(0), '\x1b[31m0\x1b[39m');
|
||||
});
|
||||
|
||||
it('don\'t output escape codes if the input is empty', function () {
|
||||
assert.equal(chalk.red(), '');
|
||||
});
|
||||
});
|
||||
|
||||
describe('chalk.enabled', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue