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

use supports-color module #306

Merged
merged 1 commit into from
Feb 7, 2015
Merged

use supports-color module #306

merged 1 commit into from
Feb 7, 2015

Conversation

gustavnikolaj
Copy link
Contributor

To check if colors should be used or not.

It allows you to force colors through the use of command line flags.

See https://github.com/sindresorhus/supports-color/blob/2ae39320b7ca26c2803b4da531ed9bbcc40d78a3/index.js#L11

The reason I need this is that when running a CI job on jenkins colored output is supported even though it's not run in a tty.

To test the output when running in no-tty mode, you can pipe the istanbul command to cat.

$ istanbul cover _mocha | cat

After applying my patch, you will still not get colors when running the above. But you can run the following to force it:

$ istanbul cover --colors _mocha | cat

Added bonus is that the module does thorough testing on more parameters and should do the right thing anywhere.

I'm not sure how to document these CLI flags in the existing code.

To check if colors should be used or not.

It allows you to force colors through the use of command line flags.

See https://github.com/sindresorhus/supports-color/blob/2ae39320b7ca26c2803b4da531ed9bbcc40d78a3/index.js#L11
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) to 97.57% when pulling 28599b5 on gustavnikolaj:feature/colorizedOutput into b9fcc4e on gotwarlost:master.

@gotwarlost
Copy link
Owner

Cool.

gotwarlost added a commit that referenced this pull request Feb 7, 2015
@gotwarlost gotwarlost merged commit bc1cbde into gotwarlost:master Feb 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants