Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ivy): ensure overrides for 'multi: true' only appear once in final providers #33104

Closed
wants to merge 7 commits into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Oct 11, 2019

At the moment, if you override a provider with mutli: true, the TestBed goes through and overrides each place where the token is provided. Then the injector processes all of them and adds each occurrence to the provider records. As a result, if you override a multi: true provider, you get too many instances in the final output. You should only get the one that was provided in the override (see the test in this PR).

@atscott atscott requested a review from a team as a code owner October 11, 2019 16:49
@atscott
Copy link
Contributor Author

atscott commented Oct 11, 2019

Presubmit
Ivy Presubmit
Should run a global ivy presubmit as well

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@atscott thanks for the fix! I left a few comments. Thank you.

packages/core/testing/src/r3_test_bed_compiler.ts Outdated Show resolved Hide resolved
packages/core/testing/src/r3_test_bed_compiler.ts Outdated Show resolved Hide resolved
packages/core/test/test_bed_spec.ts Outdated Show resolved Hide resolved
@AndrewKushnir AndrewKushnir added comp: ivy area: testing Issues related to Angular testing features, such as TestBed target: major This PR is targeted for the next major release labels Oct 11, 2019
@ngbot ngbot bot added this to the needsTriage milestone Oct 11, 2019
@AndrewKushnir AndrewKushnir self-assigned this Oct 11, 2019
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the changes @atscott 👍

@atscott atscott added the action: presubmit The PR is in need of a google3 presubmit label Oct 11, 2019
@atscott
Copy link
Contributor Author

atscott commented Oct 16, 2019

Global Ivy Presubmit

@atscott atscott added action: merge The PR is ready for merge by the caretaker and removed action: presubmit The PR is in need of a google3 presubmit action: merge The PR is ready for merge by the caretaker labels Oct 17, 2019
@atscott atscott force-pushed the multiProviders branch 2 times, most recently from c7cedcb to 8255771 Compare October 18, 2019 22:01
@atscott
Copy link
Contributor Author

atscott commented Oct 21, 2019

Ivy global presubmit 2

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks for adding extra tests!

@AndrewKushnir
Copy link
Contributor

@atscott atscott force-pushed the multiProviders branch 3 times, most recently from 4aef656 to 19a9e1b Compare October 22, 2019 19:35
@atscott
Copy link
Contributor Author

atscott commented Oct 22, 2019

@atscott atscott force-pushed the multiProviders branch 2 times, most recently from c8e19ca to 7e11882 Compare October 22, 2019 20:13
@atscott
Copy link
Contributor Author

atscott commented Oct 24, 2019

@atscott
Copy link
Contributor Author

atscott commented Oct 28, 2019

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Oct 28, 2019
mohaxspb pushed a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
mohaxspb pushed a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: testing Issues related to Angular testing features, such as TestBed cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants