Repository navigation
fix(@angular/build): apply build conditions to the Karma unit-test ru… - #34843
Open
damienwebdev wants to merge 1 commit into
Open
damienwebdev wants to merge 1 commit into
damienwebdev wants to merge 1 commit into
Conversation
…nner The Karma runner of the unit-test builder copies a fixed set of options from the build target, and `conditions` was not one of them. Pass it through to the Karma test build. Fixes angular#34836
There was a problem hiding this comment.
Code Review
This pull request introduces support for custom resolve conditions in the Karma builder. It defines a new KarmaBuilderInternalOptions type that extends the standard Karma builder options with the conditions property from the build target options. These conditions are then propagated through the Karma executor and setup build options. A new behavior test suite is also added to verify that packages are correctly resolved using these custom conditions. There are no review comments, so I have no feedback to provide.
5 of 16 tasks
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.
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
With
runner: karma, the unit-test builder copies a fixed set of options from the build target into the Karma build, andconditionsis not one of them. Packages with conditional exports resolve their default exports in Karma tests, whileng builduses the build target'sconditions.Fixes: #34836
What is the new behavior?
The Karma runner passes the build target's
conditionsto the Karma test build.Does this PR introduce a breaking change?
Other information
Reproduction: https://github.com/damienwebdev/angular-cli-conditions-repro/tree/karma. With this change, the test in
src/app/app.spec.tspasses.@angular/build:karmaused directly still has no way to set conditions. Supporting it would mean adding a publicconditionsoption to its schema and passing it the same way. I can follow up with that if it's wanted.