-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
styleText()
: isTTY check fails with --test
#57921
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
Comments
I think there's a difference with node/lib/internal/util/colors.js Lines 18 to 25 in 6cdcaa9
I think it's this line that forces the color: node/lib/internal/test_runner/runner.js Lines 375 to 377 in 6cdcaa9
The node/lib/internal/test_runner/utils.js Lines 145 to 151 in 6cdcaa9
I don't think you should force color when it's supported. It should be the functions that stylize the test results that should call |
Version
v22.13.1
Platform
Subsystem
Ubuntu 22.04.5 LTS
What steps will reproduce the bug?
Create
index.mjs
:Run
node index.mjs
Run
node --test index.mjs
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
The text No TTY isn't stylized with
--test
.node index.mjs
node --test index.mjs
What do you see instead?
The text No TTY is stylized with
--test
.node index.mjs
node --test index.mjs
Additional information
With the
--test
option, thestyleText()
function doesn't check whether the stream isTTY
.With the command line:
node --test index.mjs > out.txt
, the file contains the correct style:The text was updated successfully, but these errors were encountered: