Open SimonSiefke opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
Which version of Vitest are you using? Please include it in the System info section. There were some fixes related to this couple of months ago.
Thanks for looking into this!
I can reproduce the issue with vitest version: 0.34.1.
Here is a better repo for reproducing the issue: https://github.com/SimonSiefke/vitest-issue
Also I made this screencast of the issue with vitest continuing to run all tests after pressing p
:
https://github.com/vitest-dev/vitest/assets/23744935/9d5a940d-2daf-4933-8ce2-93047ea97da3
I'm unable to reproduce using the repository. In the recording below I let the first 4 tests finish, then click the terminal area and press p
. Tests are cancelled.
https://github.com/vitest-dev/vitest/assets/14806298/ff846277-9543-4b9d-84e7-4844fb9c6ebc
In the recording I'm using VS Code's built-in terminal. Could you try other ones and see if the issue still comes up?
Here is another recording with gnome-terminal. I'm pressing p
relatively early: After the blue DEV
shows up but before the first test outputs are visible.
https://github.com/vitest-dev/vitest/assets/23744935/eaa9a3bc-008c-4b77-81aa-29b51b672174
When I haven't pressed p
early and press p
only after 4 tests have finished, it still may wait up to 3 seconds for the next 4 tests to finish but then tests are stopped as expected.
I hope this helps!
Pressing the key early enough seems to cause some weird edge case. Tests are not cancelled as early as possible. I'm able to reproduce this now.
Describe the bug
When running vitest in watch mode, filtering is not possible. It first runs all tests (which can take several minutes) before filtering works.
Expected behaviour
When pressing p to filter, test runs stop and it it possible to filter. This is how it works in jest.
Actual behaviour
When pressing p to filter while tests are running, tests do not stop and one needs to wait until all tests finished before it is possible to filter
Reproduction
https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/
System Info
Used Package Manager
npm
Validations