Skip to content

Add 'coverageLinkUrl' option in Vitest UI for custom coverage report links #6144

@iicdii

Description

@iicdii

Clear and concise description of the problem

As a developer using Vitest, I want to be able to customize the coverage report link URL in the Vitest UI, so that I can correctly link to coverage reports hosted in custom locations, such as cloud storage services like S3.

Currently, the Vitest UI generates report HTML with coverage links based on the coverage.reportsDirectory setting. However, there's no way to customize this URL, which becomes problematic when the reports are hosted in a different location than the default.

For example, I'm uploading Vitest UI generated results to S3. The main report is accessible at https://example.com/example-client/app/report.html. However, the 'coverage' menu link incorrectly points to https://example.com/coverage/report.html instead of the correct URL https://example.com/example-client/coverage/report.html. This occurs even when the coverage.reportsDirectory is set to './html-report/coverage'.

Suggested solution

Adding an option to specify a custom coverageLinkUrl in the Vitest UI configuration would solve this issue and provide greater flexibility for developers who host their reports in various environments.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions