vitest-dev / vitest-dev/vitest
Ability to customize the HTML report
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Clear and concise description of the problem
Hi!
Thank you for building & maintaining vitest 🫶
I'd like to switch from Jest to Vitest,
but on our project we used this nice HTML reporter: https://github.com/Hazyzh/jest-html-reporters
It has a very handy feature: the customInfos field can be used to insert custom information to the final HTML report.
Vitest already has a nice builtin HTML reporter: https://vitest.dev/guide/reporters.html#html-reporter
There is even some nice documentation on the reporter API, to build your own: https://vitest.dev/api/advanced/reporters.html
However, could it be considered to provide way for @vitest/ui to provide some basic customization settings please?
Suggested solution
I'm thinking about allowing the end-user control over a <div> or <p> content on the HTML report page.
Ideally through a "hook" that could receive tests results statistics (e.g. number of OK / failed tests).
Is this something that could be considered for @vitest/ui, please?
Alternative
Maybe fork this repo and hack something into @vitest/ui, but that would be hell to maintain over years...
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @vitest/ui package and read the HTML reporter and reporter API documentation linked in the issue. Determine the supported customization scope and how a hook could receive test-result statistics. Done means an agreed, documented customization interface is implemented and verified in the HTML report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100