forked from orbit-oss/chalk
parent
0307f263cb
commit
2a678789b1
2 changed files with 16 additions and 2 deletions
|
|
@ -20,3 +20,15 @@ test('create an isolated context where colors can be disabled (by enabled flag)'
|
|||
instance.enabled = true;
|
||||
t.is(instance.red('foo'), '\u001B[31mfoo\u001B[39m');
|
||||
});
|
||||
|
||||
test('the `level` option should be a number from 0 to 3', t => {
|
||||
/* eslint-disable no-new */
|
||||
t.throws(() => {
|
||||
new chalk.constructor({level: 10});
|
||||
}, /should be an integer from 0 to 3/);
|
||||
|
||||
t.throws(() => {
|
||||
new chalk.constructor({level: -1});
|
||||
}, /should be an integer from 0 to 3/);
|
||||
/* eslint-enable no-new */
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue