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

Remove MOCHA_COLORS environment variable #3641

Closed
plroebuck opened this issue Dec 28, 2018 · 3 comments
Closed

Remove MOCHA_COLORS environment variable #3641

plroebuck opened this issue Dec 28, 2018 · 3 comments
Labels
area: usability concerning user experience or interface good first issue new contributors should look here! type: cleanup a refactor

Comments

@plroebuck
Copy link
Contributor

plroebuck commented Dec 28, 2018

Description

This environment variable was introduced in Sep 2013 by #965.
Later, we updated to use supports-color module for color support in Feb 2015 by #1545.

This module later gained its own pseudo-standard environment variable FORCE_COLOR which provides the same function in Jan 2017.

As MOCHA_COLORS provides redundant functionality, it should be removed.

Additional Information

lib/reporters/base.js

exports.useColors =
  !process.browser &&
  (supportsColor.stdout || process.env.MOCHA_COLORS !== undefined);

would become

exports.useColors = !process.browser && supportsColor.stdout;
@plroebuck plroebuck added area: usability concerning user experience or interface good first issue new contributors should look here! type: cleanup a refactor labels Dec 29, 2018
@boneskull
Copy link
Member

So FORCE_COLOR means supportsColor.stdout will be truthy?

@plroebuck
Copy link
Contributor Author

plroebuck commented Jan 3, 2019

FORCE_COLOR is numeric value so:

  • 0 disables color support
  • 1 specifies basic color support (16 color palette)
  • 2 specifies 24-bit color support (256 color palette)
  • 3 specifies 32-bit truecolor support (16m colors)

So specifying FORCE_COLOR=0 in environment will disable color support.
Likewise, FORCE_COLOR=1 will enable color support.

@outsideris
Copy link
Member

I think we wouldn't do this as #3665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: usability concerning user experience or interface good first issue new contributors should look here! type: cleanup a refactor
Projects
None yet
Development

No branches or pull requests

3 participants