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

[Bug] Terminal output is cut off while async test is executing #6590

Closed
6 tasks done
maxpatiiuk opened this issue Sep 29, 2024 · 2 comments · Fixed by #6893
Closed
6 tasks done

[Bug] Terminal output is cut off while async test is executing #6590

maxpatiiuk opened this issue Sep 29, 2024 · 2 comments · Fixed by #6893
Labels
p3-significant High priority enhancement (priority)

Comments

@maxpatiiuk
Copy link

Describe the bug

If there is an async test and the number of tests in a file is more than the height of the terminal window, then the reporter output is cut off.
More specifically, any tests that are above the fold of the terminal are not visible until all tests complete.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-zaoda8?file=test.spec.ts,vite.config.ts,package.json&initialPath=__vitest__/

Screen.Recording.2024-09-28.at.20.09.30.mov

Reproducible even with clearScreen:false Vite option.
Reproducible in Terminal, iTerm2 and VS Code terminal on macOS.
Reproducible in StackBlitz VS Code terminal.
Seems to happen regardless of terminal window size.

System Info

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 98.42 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.16.0/bin/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
  Browsers:
    Chrome: 129.0.6668.60
    Safari: 18.0
  npmPackages:
    vite: ^5.2.0 => 5.4.8
    vitest: ^2.1.1 => 2.1.1

Used Package Manager

npm

Validations

@hi-ogawa
Copy link
Contributor

This behavior seems intended as the reporter is truncating based on terminal height.

// Go through tasks in reverse order since maxRows is used to bail out early when limit is reached
for (const task of [...tasks].reverse()) {

I think it would be nice to always show tests if they are running, but that's probably better solved by reworking reporters to show summary in multiple sections in jest style, cf. #3732

@maxpatiiuk
Copy link
Author

This behavior seems intended as the reporter is truncating based on terminal height.

I see. The present behavior makes it impossible to see the status of currently executing tests that are above the fold until all tests are completed.

If you believe that #3732 would improve this, then that would be great ❤️ (especially #3732 (comment) - the flickering is quite distracting).

@github-staff github-staff deleted a comment Sep 29, 2024
@AriPerkkio AriPerkkio added the p2-to-be-discussed Enhancement under consideration (priority) label Oct 1, 2024
@AriPerkkio AriPerkkio moved this to P2 - 2 in Team Board Oct 1, 2024
@sheremet-va sheremet-va moved this from P2 - 2 to Has plan in Team Board Oct 24, 2024
@sheremet-va sheremet-va added p3-significant High priority enhancement (priority) and removed pending triage p2-to-be-discussed Enhancement under consideration (priority) labels Oct 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-significant High priority enhancement (priority)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants