Skip to content

Commit

Permalink
Merge pull request #2639 from felipecrs/fix-ci-color
Browse files Browse the repository at this point in the history
Not rely on CI=true for TTY check
  • Loading branch information
codenirvana committed Apr 4, 2021
2 parents e0f1f25 + 92ccf32 commit bb898b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/reporters/cli/cli-utils.js
Expand Up @@ -93,14 +93,13 @@ cliUtils = {
* color: | noTTY:
* 'on' -> false
* 'off' -> true
* otherwise -> Based on CI or isTTY.
* otherwise -> Based on isTTY.
*
* @param {String} color - A flag to indicate usage of the --color option.
* @returns {Boolean} - A boolean value depicting the result of the noTTY check.
*/
noTTY: function (color) {
return (color === 'off') || (color !== 'on') &&
(Boolean(process.env.CI) || !process.stdout.isTTY); // eslint-disable-line no-process-env
return (color === 'off') || (color !== 'on') && (!process.stdout.isTTY);
},

/**
Expand Down

0 comments on commit bb898b5

Please sign in to comment.