chalk/test/no-color-support.js
Richie Bendall 03067ebf3a
Keep ava on 2.x
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
2020-10-04 07:16:12 +13:00

24 lines
427 B
JavaScript

import test from 'ava';
// Spoof supports-color
require('./_supports-color')(__dirname, {
stdout: {
level: 0,
hasBasic: false,
has256: false,
has16m: false
},
stderr: {
level: 0,
hasBasic: false,
has256: false,
has16m: false
}
});
const chalk = require('../source');
test('colors can be forced by using chalk.level', t => {
chalk.level = 1;
t.is(chalk.green('hello'), '\u001B[32mhello\u001B[39m');
});