Skip to content

Option to save report in a single combined HTML file #6425

@man-of-seafood

Description

@man-of-seafood

Clear and concise description of the problem

In our CI pipeline, we generate HTML reports using @vitest/ui. Our pipeline is designed to handle self-contained files, meaning that all assets (scripts, styles, etc.) must be embedded directly within the HTML report. Currently, the generated reports include external asset references, which our pipeline cannot process correctly due to its requirement for single-file artifacts.

Suggested solution

We would like to request an option in @vitest/ui to generate fully self-contained HTML reports. This feature would inline all necessary assets into the HTML file, producing a single self-contained file that is more easily portable.

Alternative

  • Trying to make the multi-file structure work in our CI - with the config available in our CI, I've attempted to upload all the report files (i.e. all of html/), but the the original directory structure isn't preserved; all assets end up at $s3Host.$file. Potentially, an option to fully customize the src attribute to the needed assets could also solve this, but I feel that a self-contained report is ultimately the better option.

Additional context

Here's a similar issue for a jest plugin: Hazyzh/jest-html-reporters#184

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-nice-to-haveNot breaking anything but nice to have (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions