Skip to content

feat: conditional judgment for deleting the "html" reporter#9282

Closed
travzhang wants to merge 2 commits intovitest-dev:mainfrom
canyon-project:main
Closed

feat: conditional judgment for deleting the "html" reporter#9282
travzhang wants to merge 2 commits intovitest-dev:mainfrom
canyon-project:main

Conversation

@travzhang
Copy link
Copy Markdown
Contributor

@travzhang travzhang commented Dec 17, 2025

Description

This PR removes the hard dependency on the built-in html coverage reporter when resolving the coverage HTML folder exposed by the Vitest API server.

Previously, the coverage UI was only enabled when the html reporter was explicitly configured. This assumption prevents custom or third-party coverage reporters from exposing valid HTML coverage output through the Vitest server, even when they generate static HTML reports.

With this change, Vitest determines whether to expose the coverage folder based on coverage configuration and resolved output paths, rather than relying on the reporter name. This makes the behavior more flexible and allows custom HTML-based coverage reporters to integrate with the Vitest UI without needing to masquerade as the built-in html reporter.

截屏2025-12-17 19 27 51

Additional Context

This change is backward compatible with the existing html reporter behavior and does not alter the default coverage directory structure. It only relaxes the reporter-type constraint to improve extensibility for custom coverage reporters.


Tests

  • Run the tests with pnpm test:ci.

Checklist

  • This PR references a related issue discussing the behavior change.
  • Tests are added or updated to cover the new behavior.
  • No unnecessary changes to pnpm-lock.yaml.
  • Allow edits by maintainers is enabled.

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 17, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4e57396
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/694292ed0d899e0008cff9bf
😎 Deploy Preview https://deploy-preview-9282--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closes #7354, right?

@travzhang
Copy link
Copy Markdown
Contributor Author

This closes #7354, right?

Yes, but this closed issue still fails to fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants