{{ message }}
fix(@schematics/angular): add browsers option during vitest browser provider ng-add#32885
Open
maruthang wants to merge 3 commits into
Open
fix(@schematics/angular): add browsers option during vitest browser provider ng-add#32885maruthang wants to merge 3 commits into
maruthang wants to merge 3 commits into
Conversation
…vitest browser provider ng-add When adding a Vitest browser provider via ng-add, the schematic now automatically configures the 'browsers' option in angular.json with an appropriate default browser (chromium for Playwright/Preview, chrome for WebDriverIO) instead of only logging a manual instruction. Fixes angular#32401
There was a problem hiding this comment.
Code Review
This pull request updates the Vitest browser schematic to automatically configure the 'browsers' option in 'angular.json' based on the selected provider, defaulting to 'chrome' for WebdriverIO and 'chromium' for Playwright or Preview. It also includes unit tests to verify these configurations and ensure that existing settings are not overwritten. Feedback suggests refactoring the new tests into a parameterized format to reduce duplication and adding a specific test case for the preview provider to ensure full coverage.
Sorry, something went wrong.
…eterized loop and add preview provider case
…ests Combine separate playwright/webdriverio/preview tests into a single parameterized forEach block to reduce duplication and improve coverage.
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
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.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.
PR Checklist
PR Type
What is the current behavior?
When running
ng addfor a Vitest browser provider (e.g.,@vitest/browser-playwright), the schematic adds dependencies and updatestsconfig.spec.jsonbut does not configure thebrowsersoption inangular.json. Users must manually add it for tests to run in a browser instead of Node.js/jsdom.Issue Number: #32401
What is the new behavior?
The schematic now automatically configures the
browsersoption in the test target ofangular.jsonusingupdateWorkspace():chromiumfor Playwright and Preview providerschromefor WebDriverIOExisting
browsersconfigurations are preserved and not overwritten. Tests cover all three provider types and the preservation of existing config.Does this PR introduce a breaking change?