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

Redrawing summary creates noise when printing results to the terminal stdout #7292

Open
6 tasks done
fmal opened this issue Jan 19, 2025 · 2 comments
Open
6 tasks done
Labels
feat: reporters Issues and PRs related to Vitest reporters pending triage

Comments

@fmal
Copy link

fmal commented Jan 19, 2025

Describe the bug

The live update of "Duration" timer in Vitest 3 default reporter causes creating lots of entries in the terminal/command prompt when running tests as part of pre-push hook with lefthook and forwarding the results to stdout.

This wasn't the case with default reporter in Vitest 2.

Disabling the summary in default reporter and thus repainting "fixes" the issue:

export default defineConfig({
  test: {
    reporters: [
      ['default', { summary: false }]
    ]
  },
})

Related discussion: #7285. It would be nice to have summary: { duration: false } option.

Reproduction

https://github.com/fmal/vitest3-reporter

  1. clone the repo and run
npm install
npx lefthook run pre-push
  1. observe the terminal output

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M1
    Memory: 97.92 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.asdf/installs/nodejs/20.16.0/bin/node
    Yarn: 4.6.0 - ~/.asdf/installs/nodejs/20.16.0/bin/yarn
    npm: 10.8.1 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.15.3 - ~/.asdf/installs/nodejs/20.16.0/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.2
  npmPackages:
    @vitest/ui: latest => 3.0.2
    vite: latest => 6.0.7
    vitest: latest => 3.0.2

Used Package Manager

npm

Validations

@AriPerkkio
Copy link
Member

The reproduction is not public.

@AriPerkkio AriPerkkio added the feat: reporters Issues and PRs related to Vitest reporters label Jan 19, 2025
@fmal
Copy link
Author

fmal commented Jan 19, 2025

@AriPerkkio thanks for the notice, it's public now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: reporters Issues and PRs related to Vitest reporters pending triage
Projects
None yet
Development

No branches or pull requests

2 participants