jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.28k stars 6.47k forks source link

Yellow box's white text unreadable in terminal #6494

Closed TeemuKoivisto closed 6 years ago

TeemuKoivisto commented 6 years ago

Hi,

I just ran Jest on my local repo and noted that the yellow box with text "RUNS" inside is totally illegible in my terminal.

nayttokuva 2018-06-19 kello 12 51 09

My current setup is MacBook Pro (Retina, 15-inch, Mid 2015) and the integrated terminal Visual Studio Code 1.24.0.

Perhaps a different shade of yellow would create more contrast?

thymikee commented 6 years ago

Actual color value of yellow depends on your terminal preferences (e.g. a theme you're using). For displaying the message with a background, we use the inverse of the default terminal font color. So, it would indicate your default color is blackish?

This is how it looks for me, my default color is white on dark background:

screen shot 2018-06-19 at 14 14 13
TeemuKoivisto commented 6 years ago

Hmm I have VSCode's Dark+ (default dark). So to fix this I have to change my terminal colors or some jest setting? I have kept my setup quite minimal as possible so I'd prefer not having to change something for the sake of running a single npm command.

thymikee commented 6 years ago

There's no jest config for that. Not sure why it's not playing nice with your theme 🤷‍♀️

dcalhoun commented 6 years ago

This seems to be an issue specific to xterm.js. It is supposedly fixed, but I still see this issue within zeit/hyper, which utilizes xterm.js.

You can see below that the reverse color works correctly in macOS Terminal, but is incorrect in Hyper. Both are using the same color scheme via terminal-snazzy and hyper-snazzy respectively.

It makes sense that @TeemuKoivisto has seen this in VSCode, as it utilizes xterm.js as well. @thymikee any thoughts on why this may be the case?

macOS Terminal (correct)

terminal-correct

Hyper (incorrect)

xterm-incorrect

Tyriar commented 6 years ago

It looks like this should be tracked in the xterm.js repo. If someone familiar with jest could look into what data is actually being sent to print the black on yellow block that would be helpful. You can also run the xterm.js demo and enable debug mode to see in the console what's being sent over.

SimenB commented 6 years ago

I agree it does not belong in this repo. Happy to reopen if we're doing something weird.

If someone familiar with jest could look into what data is actually being sent to print the black on yellow block that would be helpful.

Runs: https://github.com/facebook/jest/blob/37caeddebae5903b1c206318c1923a602b826c48/packages/jest-cli/src/reporters/Status.js#L23-L24

Fails/Pass: https://github.com/facebook/jest/blob/37caeddebae5903b1c206318c1923a602b826c48/packages/jest-cli/src/reporters/get_result_header.js#L19-L28

Tyriar commented 6 years ago

Seems to work in VS Code. Using this repro:

const chalk = require('chalk');

console.log(chalk.reset.inverse.yellow.bold('test'));

VS Code (xterm.js 3.7.0+):

screen shot 2018-09-23 at 11 31 00 am

Hyper (xterm.js 3.4.1?):

screen shot 2018-09-23 at 11 32 58 am

I guess https://github.com/zeit/hyper/pull/3214 will fix this for Hyper?

dcalhoun commented 6 years ago

@Tyriar ah, ok. I had not noticed VS Code was now repaired or that Hyper had a xterm.js upgrade on the way. I'll keep an eye on this and open a new issue in xterm.js repository if the issue persists after Hyper's upgrade.

dcalhoun commented 6 years ago

I just tested running Hyper with xterm.js 3.7.0 and this issue no long occurs. 🎉 Whenever Hyper releases an update upgrading xterm.js, this should be resolved. Thanks for the help.

hyper-xterm-3 7 0
github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.