fix(@angular/build): validate V8 coverage support for browsers in Vitest#32987
Open
clydin wants to merge 1 commit intoangular:mainfrom
Open
fix(@angular/build): validate V8 coverage support for browsers in Vitest#32987clydin wants to merge 1 commit intoangular:mainfrom
clydin wants to merge 1 commit intoangular:mainfrom
Conversation
1574491 to
f28dabb
Compare
There was a problem hiding this comment.
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.
packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts
Outdated
Show resolved
Hide resolved
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.
f28dabb to
dba32cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.