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

In Node.js 12 or newer, add hasColors to the fake TTY methods #2170

Closed
novemberborn opened this issue Jun 30, 2019 · 3 comments · Fixed by #2177
Closed

In Node.js 12 or newer, add hasColors to the fake TTY methods #2170

novemberborn opened this issue Jun 30, 2019 · 3 comments · Fixed by #2177
Labels
bug current functionality does not work as desired 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted

Comments

@novemberborn
Copy link
Member

novemberborn commented Jun 30, 2019

Issuehunt badges

We're missing hasColors() in our fake TTY implementation: https://github.com/avajs/ava/blob/533ee4bc54cbcd1c2b6ab5c67f3ec8a699965269/lib/worker/fake-tty.js

It was introduced in Node.js 11, so we should check if the worker is running in Node.js 12 before adding it (Node.js 11 is end of life, see #2169). We should be able to piggy-back off of the colorDepth value that's already available. I don't think we can make it work with arbitrary env variables though. We can deal with that as a follow-up.

Currently this is causing CI to fail with Node.js 12.5.0: https://travis-ci.org/avajs/ava/jobs/552425902


IssueHunt Summary

Backers (Total: $40.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@novemberborn novemberborn added bug current functionality does not work as desired help wanted labels Jun 30, 2019
@oantoro
Copy link
Contributor

oantoro commented Jun 30, 2019

in simulateTTY() requires colorDepth option to define the getColorDepth() method. Should hasColors() be defined the same way as getColorDepth()? @novemberborn

@novemberborn
Copy link
Member Author

@okyantoro it also requires colorDepth, yes, but getColorDepth() is available in Node.js 10 and hasColors() should only be made available in Node.js 12 and newer. Perhaps a typeof process.stderr.hasColors() is sufficient to see if it needs to be shimmed.

@issuehunt-oss
Copy link

issuehunt-oss bot commented Jul 3, 2019

@issuehunt has funded $40.00 to this issue.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants