[ Web Proxy ]
URL:
Viewing: https://github-redirect.dependabot.com/webpack/webpack-dev-server/issues/1555 [Back]  [Original]

fix(bin/options): correct check for color support (`options.color`) by jayjun Pull Request #1555 webpack/webpack-dev-server GitHub
Skip to content

Navigation Menu

Sign in
Search/
Sign up

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

Merged
michael-ciniawsky merged 2 commits into
webpack:masterfrom
jayjun:color
Oct 30, 2018
Merged

michael-ciniawsky merged 2 commits into
webpack:masterfrom
jayjun:color

Conversation

@jayjun [@jayjun]

@jayjun [@jayjun] jayjun commented Oct 30, 2018
edited
Loading

Copy link
Copy Markdown
Contributor
  • 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

[Go]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Hide comment]

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

[Go]
@michael-ciniawsky [@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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Hide comment]

@jayjun Thx

[Go]

codecov Bot commented Oct 30, 2018

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph [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.

[Go]
This was referenced Mar 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Footer

© 2026 GitHub, Inc.

Web Proxy Viewer  |  New URL  |  Original Page