add support for chalk/stderr (closes #301)
This commit is contained in:
parent
c25c32a25f
commit
ba3274ad0c
6 changed files with 264 additions and 225 deletions
|
|
@ -7,6 +7,12 @@ const DEFAULT = {
|
|||
hasBasic: true,
|
||||
has256: true,
|
||||
has16m: true
|
||||
},
|
||||
stderr: {
|
||||
level: 2,
|
||||
hasBasic: true,
|
||||
has256: true,
|
||||
has16m: false
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
19
test/stderr.js
Normal file
19
test/stderr.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import test from 'ava';
|
||||
|
||||
// Spoof supports-color
|
||||
require('./_supports-color')(__dirname);
|
||||
|
||||
const chalk = require('../source');
|
||||
const chalkStderr = require('../stderr');
|
||||
|
||||
test('import chalk/stderr with supports-color information for fd2', t => {
|
||||
t.is(chalk.level, 3);
|
||||
t.is(chalkStderr.level, 2);
|
||||
t.is(chalkStderr.red('foo'), '\u001B[31mfoo\u001B[39m');
|
||||
});
|
||||
|
||||
test('create isolated instance of stderr chalk', t => {
|
||||
const instance = new chalkStderr.Instance();
|
||||
t.is(instance.level, 2);
|
||||
t.is(instance.red('foo'), '\u001B[31mfoo\u001B[39m');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue