Repository navigation
fix(@angular/build): require only the launchers the karma configuration loads - #34576
Merged
alan-agius4 merged 2 commits intoOct 29, 2026
Merged
Conversation
…on loads The upfront dependency validation of the unit-test builder's karma runner derives a launcher package from each browser name. This requests packages that do not exist, such as `karma-chromium-launcher` for `ChromiumHeadless` (provided by `karma-chrome-launcher`) or a package named after a custom launcher defined in a Karma configuration file, so `ng test` fails before running. Follow the vitest runner: skip the launcher validation when a custom configuration is used, since it loads its own plugins, and otherwise require `karma-chrome-launcher`, the only launcher of the built-in configuration. New unit specs for the karma runner's dependency validation fail without this change.
There was a problem hiding this comment.
Code Review
This pull request simplifies Karma browser launcher dependency validation by only checking for 'karma-chrome-launcher' when no custom runner configuration is specified, rather than dynamically checking based on the configured browsers. Unit tests have been updated to reflect and verify this behavior. The feedback suggests omitting 'runnerConfig: false' in the unit tests to avoid type-safety issues, as 'undefined' is sufficient to represent the absence of a custom configuration.
…iguration loads Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Collaborator
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.
The upfront dependency validation of the unit-test builder's karma runner derives a launcher package from each browser name. This requests packages that do not exist, such as
karma-chromium-launcherforChromiumHeadless(provided bykarma-chrome-launcher) or a package named after a custom launcher defined in a Karma configuration file, song testfails before running.Follow the vitest runner: skip the launcher validation when a custom configuration is used, since it loads its own plugins, and otherwise require
karma-chrome-launcher, the only launcher of the built-in configuration. New unit specs for the karma runner's dependency validation fail without this change.