Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(bin/options): correct check for color support (options.color) #1555

Merged
merged 2 commits into from
Oct 30, 2018

Conversation

jayjun
Copy link
Contributor

@jayjun jayjun commented Oct 30, 2018

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

No, tests would require not setting the option (allow default) and running in different environments (TTY vs. non-TTY). Moreover, supports-color has special behaviour for CIs.

Motivation / Use-Case

Since supports-color 5.0.0 (chalk/supports-color#64),

return require("supports-color")

returns an object instead of the test result. Because an object is truthy, colours are enabled by default irrespective of TTY or FORCE_COLOR settings.

return require("supports-color").stdout

is the correct way to use supports-color now.

Breaking Changes

None.

Additional Info

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, due no tests please add comment in code why we use this with link on issue/PR

@alexander-akait alexander-akait added this to the 3.1.11 milestone Oct 30, 2018
@michael-ciniawsky michael-ciniawsky changed the title fix(options): fix color option fix(bin/options): correct check for color support (options.color) Oct 30, 2018
Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayjun Thx

@codecov
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #1555 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1555   +/-   ##
=======================================
  Coverage   74.02%   74.02%           
=======================================
  Files          10       10           
  Lines         670      670           
=======================================
  Hits          496      496           
  Misses        174      174
Impacted Files Coverage Δ
bin/options.js 100% <100%> (ø) ⬆️
lib/Server.js 81.36% <0%> (ø) ⬆️
bin/utils.js 44.44% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 927a2b3...a1493fb. Read the comment docs.

This was referenced Mar 13, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants