Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not rely on CI=true for TTY check #2639

Merged
merged 3 commits into from Apr 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 isatty.
*
* @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') && (!require('tty').isatty(1));
felipecrs marked this conversation as resolved.
Show resolved Hide resolved
},

/**
Expand Down