forked from orbit-oss/chalk
This commit is contained in:
parent
4d9c98c603
commit
72d1c11e43
3 changed files with 31 additions and 15 deletions
8
test.js
8
test.js
|
|
@ -68,6 +68,14 @@ describe('chalk.enabled', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('chalk.constructor', function () {
|
||||
it('should create a isolated context where colors can be disabled', function () {
|
||||
var ctx = new chalk.constructor({enabled: false});
|
||||
assert.equal(ctx.red('foo'), 'foo');
|
||||
assert.equal(chalk.red('foo'), '\u001b[31mfoo\u001b[39m');
|
||||
});
|
||||
});
|
||||
|
||||
describe('chalk.styles', function () {
|
||||
it('should expose the styles as ANSI escape codes', function () {
|
||||
assert.equal(chalk.styles.red.open, '\u001b[31m');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue