fix missing TERM cases

This commit is contained in:
Josh Junon 2017-06-29 20:11:09 -07:00
parent 3fca6150e2
commit caeb7d8dca
2 changed files with 7 additions and 1 deletions

View file

@ -133,6 +133,12 @@ describe('chalk on windows', () => {
delete require.cache[resolveFrom(__dirname, 'ansi-styles')];
});
it('should detect a simple term if TERM isn\'t set', () => {
delete process.env.TERM;
const chalkCtx = importFresh('.');
assert.equal(chalkCtx.blue('foo'), '\u001B[94mfoo\u001B[39m');
});
it('should replace blue foreground color in cmd.exe', () => {
process.env.TERM = 'dumb';
const chalkCtx = importFresh('.');