How to filter tests in CLI (without actually running everything else before) #6833
-
I've been working with mocka, where marking a test as I was also using the The behavior I'm getting in vitest, instead, is that first all hooks/tests that would happen before the filtered test are checked and listed as skipped (which takes a while) and only then the test is run. That increases test iteration time enormously, moving it
I'm aware of watch mode, and the ability to stop tests inside it with Is there any way around this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Probably Or in the future, we'll have a filtering by line number like |
Beta Was this translation helpful? Give feedback.
-
The hooks inside the file where there is an We do not plan to change the behaviour. |
Beta Was this translation helpful? Give feedback.
You would also need a —no-isolate flag for this to work. But even then the changes to the test lifecycle would be too big to support this use case. There is a lot of expectation in the code about how it works and introducing this inconsistency would make it hard to maintain and even harder to document and explain the different models.
I would recommend specifying the test file when debugging or using the vscode extension (or your IDE extension directly)