vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.64k stars 1.13k forks source link

Invisible text in terminal #383

Closed xsrvmy closed 2 years ago

xsrvmy commented 2 years ago

Describe the bug

When a test fails, part of the text produced by the terminal uses ANSI black. On many terminal themes this produces invisible text.

image

Note that the invisible text is the darkest test in the selection, NOT the part that is barely visible.

Reproduction

Run vitest on any test that will fail

System Info

System:
    OS: Linux 5.15 Arch Linux
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
    Memory: 19.27 GB / 31.08 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.volta/tools/image/node/16.13.1/bin/node
    Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.3.0 - ~/.volta/tools/image/npm/8.3.0/bin/npm
  Browsers:
    Firefox: 95.0.2
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.1.3
    vite: ^2.7.2 => 2.7.10
    vitest: ^0.0.124 => 0.0.124

Used Package Manager

npm

Validations

Aslemammad commented 2 years ago

What terminal do you use?

antfu commented 2 years ago

I don't think we use any black ANSI in our codebase and I didn't see it myself. Might be caused by something else?

Aslemammad commented 2 years ago

Yea, I guess the same, that's why I'd like to see in which terminal this happens!

xsrvmy commented 2 years ago

This was on alacritty. I'll test in KDE Konsole and report back.

Aslemammad commented 2 years ago

@xsrvmy is right, i'm gonna send a PR for that. image

sheremet-va commented 2 years ago

This was on alacritty. I'll test in KDE Konsole and report back.

Do you have anything to report? Can we close the issue?

xsrvmy commented 2 years ago

It looks like this is actually a issue depending on what terminal is used. In Alacritty and Konsole, setting dim gray will use the black color, which is often invisible. In kitty, dim uses transparency so this works.

antfu commented 2 years ago

I believe this is more like a theme issue since we don't have control of the actual color rendered. Please raise the issue to your theme/terminal instead.