Apr. (#5)
* Fix XO linting and update some dev dependencies Fixes #275 * Add some badges to the readme * Tiny travis.yml tweak * Require Node.js 6 * Validate the `level` option Fixes #248 * Add failing test for #234 (#235) * Add type definitions badge (#286) * Add Tidelift mention in the readme * Replace RawGit URL Fixes #305 * Fix ignore chars regex flags in rainbow example (#306) Use global matches rather than stopping after the first match. * Strict mode in Flow definition (#309) * Add security section * Add docs comments and tests for TypeScript definitions (#299) Fixes #293 * Update dependencies and meta tweaks * Type definition improvements * Enforce `chalk.constructor` to be called with `new` in TypeScript * Add extra level/enabled property info in the readme (#308) * Code style tweaks * Change tagged template literal argument type to accept `unknown` instead of just `string` (#316)
This commit is contained in:
parent
9776a2ae5b
commit
029b69e482
26 changed files with 760 additions and 479 deletions
|
|
@ -28,36 +28,36 @@ test.beforeEach(() => {
|
|||
|
||||
test('detect a simple term if TERM isn\'t set', t => {
|
||||
delete process.env.TERM;
|
||||
const m = importFresh('..');
|
||||
t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.blue('foo'), '\u001B[94mfoo\u001B[39m');
|
||||
});
|
||||
|
||||
test('replace blue foreground color in cmd.exe', t => {
|
||||
process.env.TERM = 'dumb';
|
||||
const m = importFresh('..');
|
||||
t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.blue('foo'), '\u001B[94mfoo\u001B[39m');
|
||||
});
|
||||
|
||||
test('don\'t replace blue foreground color in xterm based terminals', t => {
|
||||
process.env.TERM = 'xterm-256color';
|
||||
const m = importFresh('..');
|
||||
t.is(m.blue('foo'), '\u001B[34mfoo\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.blue('foo'), '\u001B[34mfoo\u001B[39m');
|
||||
});
|
||||
|
||||
test('don\'t apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', t => {
|
||||
process.env.TERM = 'dumb';
|
||||
const m = importFresh('..');
|
||||
t.is(m.gray.dim('foo'), '\u001B[90mfoo\u001B[22m\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.gray.dim('foo'), '\u001B[90mfoo\u001B[22m\u001B[39m');
|
||||
});
|
||||
|
||||
test('apply dimmed styling on xterm compatible terminals', t => {
|
||||
process.env.TERM = 'xterm';
|
||||
const m = importFresh('..');
|
||||
t.is(m.gray.dim('foo'), '\u001B[90m\u001B[2mfoo\u001B[22m\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.gray.dim('foo'), '\u001B[90m\u001B[2mfoo\u001B[22m\u001B[39m');
|
||||
});
|
||||
|
||||
test('apply dimmed styling on strings of other colors', t => {
|
||||
process.env.TERM = 'dumb';
|
||||
const m = importFresh('..');
|
||||
t.is(m.blue.dim('foo'), '\u001B[94m\u001B[2mfoo\u001B[22m\u001B[39m');
|
||||
const chalk = importFresh('..');
|
||||
t.is(chalk.blue.dim('foo'), '\u001B[94m\u001B[2mfoo\u001B[22m\u001B[39m');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue