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
Show test failure details in UI report tab #684
Comments
Hi, thank you for the suggestion! I created #685 to address this issue. Does the attached screenshot meet your requirements? |
Thank you @DerYeger for your speedy PR! Yeah it looks good! Out of curiosity, the |
Thanks!
I'm not sure, since I haven't worked on the terminal output. |
That makes sense, thanks for explaining. Look forward to trying this out once it's merged (unless there's another way you'd want me to test this before merging and I'll be happy to do so). |
There is |
Looks like there's some info here that may be potentially useful:
|
@Demivan @uicrafts In what way should the logs be used here? There already is a logs view. |
I thought logs are not being displayed if test fails. If they are, then everything is fine. |
I apologize if perhaps I didn't clarify things correctly when opening this issue! The original idea/suggestion that prompted me to open this thread was that when tests fail, the terminal shows the log details for that failure, but the UI doesn't. Here's an example of a snapshot test (but the same happens with unit tests): As you can see, the UI only displays the name of the failed component, but no logs/details for the test failure like we see in the terminal. @Demivan looking at the |
@uicrafts can you go in that case to code tab? IIRC that error is shown in the code. |
@userquin I thought that might be the case too initially, but it looks like the Edit: just saw the screenshot you shared, and I can confirm I'm not seeing that for failed snapshot or unit tests, at least on |
@uicrafts it seems EDIT: you can modify the tests on the code tab and then crtl + s or command + s to save it. |
@userquin Ah, thanks for confirming on your end that it's a bug 👍 Also, that's a nice tip about being able to update the tests and save the file from the UI -- another cool feature in Vitest 👌 |
@uicrafts I think my PR does just that. The @Demivan The logs of failing tests are included. |
The document correctly specified that this works in effect scope, and does nothing if not. Change the comment in code to be the same as in the document.
Clear and concise description of the problem
Currently when a test fails, the details of the failure are shown in the terminal, but it would be great if they were also displayed in the UI. I've tested this on a React project with TypeScript.
Suggested solution
The UI of Vitest is such a killer feature, so thank you for building this! At the moment the UI only marks the test case as failed, but the "Report" tab only renders the name of the component. Ideally, it would display the details of the test failure. Has this been considered?
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: