-
-
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
Ability to customize the "assetPrefix" for HTML report. #6357
Comments
It looks like all assets inside html are relative, so accessing https://onchainkit.xyz/coverage/index.html seems to work already. I think if you tweak a vercel config, then https://onchainkit.xyz/coverage/ would also work too (currently 404). If you want trailing slash stripped |
@hi-ogawa thank you for the quick reply. So we use the Also, knowing https://onchainkit.xyz/coverage/index.html works and sublinks too https://onchainkit.xyz/coverage/src/identity/hooks/index.html, that's very good news. 🗞️ Now I wonder, if I should experiment with |
Btw, Vitest's coverage reporter generation is delegated to istanbuljs (like html reporter here https://github.com/istanbuljs/istanbuljs/blob/main/packages/istanbul-reports/lib/html/index.js), so the feature request needs to go there if this requires fundamental change. I just found they support custom One quick hack I'm thinking is to inject |
Feel free to close this issue, I end up using https://onchainkit.xyz/coverage/ with |
Yeah, your setup looks good to me 👍 Okay closing. |
Clear and concise description of the problem
We are using Vite for https://onchainkit-coverage.vercel.app/, which loads really well when used at the top-level domain.
But as soon as we run the report in its own subfolder, https://onchainkit.xyz/coverage, the HTML report struggles to handle static files and page links.
Suggested solution
I think one feature that could make this super easy is the ability to set
assetPrefix
. This would be similar to what Next.js has at https://nextjs.org/docs/app/api-reference/next-config-js/assetPrefix.Ideally, that can be added to the report config
Thank you again for building Vitest. We really love writing test with it.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: