forked from orbit-oss/chalk
add .hasColor() method - fixes #23
This commit is contained in:
parent
eff96c2c15
commit
90bd6477d6
4 changed files with 15 additions and 1 deletions
7
test.js
7
test.js
|
|
@ -63,6 +63,13 @@ describe('chalk.styles', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('chalk.hasColor()', function () {
|
||||
it('should detect whether a string has color', function () {
|
||||
assert(chalk.hasColor(chalk.blue('foo')));
|
||||
assert(!chalk.hasColor(chalk.stripColor(chalk.blue('foo'))));
|
||||
});
|
||||
});
|
||||
|
||||
describe('chalk.stripColor()', function () {
|
||||
it('should strip color from string', function () {
|
||||
assert.equal(chalk.stripColor(chalk.underline.red.bgGreen('foo')), 'foo');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue