vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.98k stars 1.16k forks source link

In the UI show test report when clicking on a test #6747

Open noam-honig opened 6 days ago

noam-honig commented 6 days ago

Clear and concise description of the problem

Currently when I use the UI with the --ui flag, when I click a test on the UI nothing happens, there's a button to show the source code - but that's less useful (and also doesn't show the source of the test, just the source of the entire file) There is an "Open test details" that is available only on the test file level - the same icon on the test level does the "show code" functionality.

Suggested solution

The dream would be to click a test and see why it failed.

When I click on the test in the left panel, show that specific test's report. If I had my way, the tabs should be "Report" "Console" (also preferrably for the clicked test only) than code and module graph.

Checkout this stackblitz to see my current experience: https://stackblitz.com/edit/api-test-example-qrjqcu?file=test.spec.ts

Alternative

No response

Additional context

No response

Validations

jycouet commented 6 days ago

This would improve the UI and make it more usefull 👍 Thx

pav-stastny commented 3 days ago

It was really confusing for me, why clicking in the list does "nothing". Probabyl one small improvement before fully integrationg the suggestion, would be to handle click on list item same as the click on the ICON. Currently there is a cursor hinting interactive list element, but it does nothing.

image

noam-honig commented 3 days ago

@pav-stastny Yes but :) on a file line - it opens the report tab, on a test line it opens the code tab (and doesn't even focus on the code for that test)

Quick solution, have it open the report tab for that test or if not possible, for the file.

Thanks