Skip to content

Test summary during watch mode run #3732

@sethreidnz

Description

@sethreidnz

Clear and concise description of the problem

The proposal is to show a live-updating summary of the current test run instead of the list of tests that have ran and are running. This would provide a consistent UI that the user can see the progress of the run toward finishing while also outputting the error messages from failed tests as fast as possible. I believe this will both improve workflow of developers and improve the perceived performance of Vitest.

I'm happy to contribute and expand on anything here that you would like.

Suggested solution

Instead of showing the list of all tests suites as they are ran as is the current UI, Vitest could instead show a live-updating summary of the current run of tests. This would look somewhat similar to the Jest watch UI and could show things such as:

  • Total tests run
  • Total failures
  • Total passes
  • Total skipped
  • Total tests to run
  • Total time
  • Current status (pass or fail overall)

While making this change it will also be important to ensure that:

  • The UI is interruptible and responsive so that the user can pause execution and change things such as filename pattern
  • Test failures are printed above the summary as soon as they happen so that the user can scroll up and see the first failed test as soon as possible when running multiple test suites.
  • Test console output is also included in the correct order along with the test failures so that the messages can be read for debugging

Alternative

I'm aware there is Vitest UI which I am yet to properly check out. On my current project I have had issues getting it going so haven't had a chance to look at it. Although it may improve on the current watch experience it would still be great to improve the default cli experience.

Additional context

I would love to contribute to this and if you have other better ideas or plans that I've missed then let me know and I could help! I've just migrated a project onto Vite that has more than 10k tests and so far I'm really enjoying Vite!

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Approved

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions