Skip to content

fix(@angular/build): validate V8 coverage support for browsers in Vitest#32987

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:vitest/browser-coverage-val
Open

fix(@angular/build): validate V8 coverage support for browsers in Vitest#32987
clydin wants to merge 1 commit intoangular:mainfrom
clydin:vitest/browser-coverage-val

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 10, 2026

This change introduces a validation check in the Vitest runner to ensure that code coverage is only enabled when using supported Chromium-based browsers. Since the Angular CLI integration currently relies exclusively on the V8 coverage provider, running tests in non-Chromium browsers like Firefox or Safari with coverage enabled would result in incomplete data or missing reports. By adding this check, developers will receive a clear, actionable error message early in the process, preventing confusion and ensuring reliable coverage reports.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Apr 10, 2026
@clydin clydin force-pushed the vitest/browser-coverage-val branch from 1574491 to f28dabb Compare April 11, 2026 01:17
@clydin clydin marked this pull request as ready for review April 11, 2026 04:11
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 11, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces validation to ensure that V8 code coverage is only enabled for supported Chromium-based browsers when using the Vitest runner, and adds an E2E test to verify this behavior. A review comment identifies that the current implementation only checks the instances property from CLI options, potentially bypassing validation for browsers configured via the name property or within vitest.config.ts. A code suggestion is provided to make the validation more robust by checking these additional configuration sources.

This change introduces a validation check in the Vitest runner to ensure that code coverage is only enabled when using supported Chromium-based browsers. Since the Angular CLI integration currently relies exclusively on the V8 coverage provider, running tests in non-Chromium browsers like Firefox or Safari with coverage enabled would result in incomplete data or missing reports. By adding this check, developers will receive a clear, actionable error message early in the process, preventing confusion and ensuring reliable coverage reports.
@clydin clydin force-pushed the vitest/browser-coverage-val branch from f28dabb to dba32cf Compare April 13, 2026 15:58
@clydin clydin requested a review from alan-agius4 April 13, 2026 21:02
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants