chalk/test/no-color-support.js

25 lines
427 B
JavaScript
Raw Normal View History

2018-09-18 04:48:47 -04:00
import test from 'ava';
// Spoof supports-color
require('./_supports-color')(__dirname, {
2019-09-22 12:07:33 +03:00
stdout: {
level: 0,
hasBasic: false,
has256: false,
has16m: false
},
stderr: {
level: 0,
hasBasic: false,
has256: false,
has16m: false
}
2018-09-18 04:48:47 -04:00
});
2019-07-12 13:51:07 +07:00
const chalk = require('../source');
2018-09-18 04:48:47 -04:00
test('colors can be forced by using chalk.level', t => {
chalk.level = 1;
2018-09-18 04:48:47 -04:00
t.is(chalk.green('hello'), '\u001B[32mhello\u001B[39m');
});