-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
enhancement: pending triagep2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Description
Clear and concise description of the problem
As brought up in #9626 (comment), builtin HTML reporter and ui mode currently rely on special onFinishedReportCoverage method to wait for coverage html generation because currently available onTestRunEnd is too early.
vitest/packages/vitest/src/node/core.ts
Lines 1380 to 1389 in 86fad4b
| await this.coverageProvider.reportCoverage(coverage, { allTestsRun }) | |
| // notify builtin ui and html reporter after coverage html is generated | |
| for (const reporter of this.reporters) { | |
| if ( | |
| 'onFinishedReportCoverage' in reporter | |
| && typeof reporter.onFinishedReportCoverage === 'function' | |
| ) { | |
| await reporter.onFinishedReportCoverage() | |
| } | |
| } |
Suggested solution
Add Reporter.onCoverageReport method which gets triggered after coverage report.
Alternative
No response
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 request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancement: pending triagep2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)
Type
Projects
Status
P2 - 2