-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Custom UI results messages #7581
Comments
Can you be more specific about the use case? I think it would help if you can provide an example code and ui with (hypothetical) API as a proposal to understand Vitest side requirement better, then we can brush it up as needed. |
The feature sounds too specific to html reporter, so I'm not sure what's the right direction. One idea came to my mind is that to reuse test(
'-- site is runnning',
async (ctx) => {
...
// custom message as task.meta
ctx.task.meta.__htmlSuccessMessage = `
<h1>Success!</h1>
<p>You file are found here</p>
<a href="file1.html">File 1</a>
<a href="file2.html">File 2</a>
<a href="file3.html">File 3</a>
`
}
) |
That could work! using meta would be super easy and will work with JSON reporter which we're already using. |
I've been meaning to add something similar to test(
'-- site is runnning',
{ attachments: [{ title: 'file 1', link: 'file1.html' }] },
async () => {
// ...
},
) Or test(
'-- site is runnning',
async ({ attachments }) => {
attachments.add({ title: 'file 1', link: 'file1.html' })
},
) |
Clear and concise description of the problem
Hello, we'd like a way to show custom HTML messages in the test results sections in vitest UI. For example, we dynamically generate some artifacts in the tests and would like to reference them with a link from the UI test results.
PS: We love Vitest, especially the UI reporter with static file generation. Thanks for the fantastic work.
Suggested solution
Add some parameter or configuration option to the tests to inject these messages into the latest UI results.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: