vitest-dev / vitest

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

Terminal UI flickering #6177

Open TomPridham opened 2 months ago

TomPridham commented 2 months ago

Describe the bug

When running vitest there is a significant amount of flickering in the console that makes it really unpleasant to look at This is a video of my terminal output with vitest

My desire would be some sort of low motion option or something that makes the output more static.

Reproduction

This seems to be caused because vitest is rewriting the console output to do the animations on the running tests and when there are tests that are logging a lot or errors being printed to stdout it causes the unpleasant visual flickering. This repo reproduces it with just two tests with some timeouts. Our codebase at work has a couple hundred tests that print console errors quite a lot, so there is significantly more flickering https://github.com/TomPridham/vitest-ui-flickering

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 11.59 GB / 64.00 GB
    Shell: 3.2.57 - /bin/sh
  Binaries:
    Node: 20.15.1 - /usr/local/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.5.0 - /usr/local/bin/pnpm
    bun: 1.1.21 - /usr/local/bin/bun
  Browsers:
    Chrome: 126.0.6478.183
    Safari: 17.5
  npmPackages:
    @vitest/ui: ^1.6.0 => 1.6.0
    vitest: ^1.6.0 => 1.6.0

Used Package Manager

npm

Validations

AriPerkkio commented 2 months ago

Maybe this could help here? https://github.com/vitest-dev/vitest/issues/3732#issuecomment-2071861326