Skip to content

Commit

Permalink
spoof supports-color
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Jun 29, 2017
1 parent 18f2e7c commit 608242a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test.js
Expand Up @@ -2,11 +2,21 @@
const assert = require('assert');
const importFresh = require('import-fresh');
const resolveFrom = require('resolve-from');

// Spoof supports-color
require.cache[resolveFrom(__dirname, 'supports-color')] = {
exports: {
level: 3,
hasBasic: true,
has256: true,
has16m: true
}
};

const chalk = require('.');

console.log('host TERM=', process.env.TERM || '[none]');
console.log('host platform=', process.platform || '[unknown]');
console.log('host support=', chalk.supportsColor);

describe('chalk', () => {
it('should style string', () => {
Expand Down

0 comments on commit 608242a

Please sign in to comment.