-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CLI: Show full test suite when testing 1 spec file at a time (like Jest does) #3266
Comments
Does the |
oh I didn't realize we could simply change the reporter, however it does help but only partially. If I enable the verbose reporter, then all test suite are now showing with their entire line of tests which is way too much data to show. I still wish to see the same logic that Jest does by default which is to show all tests only when you are testing 1 file at a time (ie file pattern), basically if I'm not in 1 file at a time then I still wish to see the single test description. It would also be nice to see other UI improvements that I mentioned in the print screens |
It works as expected. If they were different, you would see the diff in red. I am fine with other changes (we can also print expected/received before the diff).
I don't think it justifies bringing the library for this to be honest 🤔 |
The implemented solution has a bug that we need to resolve to properly close this issue. It shows all tests even when the suite did not finish running which makes it very hard to see |
Clear and concise description of the problem
Coming from Jest, I find that this feature is missing in Vitest and I do like to see the full list of tests (from a single spec file) when I'm currently working on a specific test suite. The way it works in Jest is that if you are testing all test suites (or all spec files), then it shows you only the title of each test suite (Vitest does that too, great!). However if you then add/update some test(s) under a single test suite or spec file (or if you are using "p" for pattern which returns a single spec file), then Jest will show the entire list of tests that belong to that specific spec test suite (Vitest does not do that, it only shows the test suite title in every case, that is the same output for a single spec file or multiple spec files).
For example in Jest when testing 1 spec file test suite, it shows all tests under it (in this case 12 tests), it's quite handy to see the full list, also sometime there are skipped tests that I can see in this list but I can't see them in Vitest
On the other hand, Vitest is only ever showing the title of the describe test suite title. There are 4 tests under that spec file but it never shows them and I would really like to get the same view that Jest provides me which is helpful when troubleshooting a single spec test file
Suggested solution
Provide the same view as Jest does (which is to show the full list of tests under the spec file test suite)
Alternative
it's simply missing in Vitest, there are no alternative that I know of
Additional context
There are more things to note about the print screens that I provided on top, I mention that we do not see the full list of tests under the test suite in Vitest... however that is not entirely true when we have an test failing, then we do see a summary similar to Jest. But even then, I still prefer Jest's UI in this case, the color they chose and the alignment of the text is simply easier to read in Jest. Also in Jest the spec filename is not shown on the same line as the describe test suite title, but in Vitest it's all on the same line (and it most often overflows) and I find that also harder to read and find which spec file and tests really failed
when failing in Jest, it's quite easy to read and find which test failed
when failing in Vitest, it's not as easy to read and trying to find the test that failed also seems much harder to see in the result window, I think it could be improved (for example separating the spec filename and the test describe under separate lines would help, and also use better or less colors)
Update
The comment below to improve colors got fixed and merged in PR #3349. The main enhancement requested in this issue, which is to show full report when runing single spec file, is still unaddressed
Validations
The text was updated successfully, but these errors were encountered: