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): Handle overrides for {providedIn: AModule} in R3TestBed #33606

Closed
wants to merge 1 commit into from

Conversation

@atscott
Copy link
Contributor

atscott commented Nov 5, 2019

This issue was found when debugging a test failure that was using lazy
loaded modules with the router. When doing this, the router calls
NgModuleFactory.create for the loaded module. This module gets a new
injector so the overrides provided in TestBed are not applied unless the
Injectable is in the providers list (which is not the case for
{providedIn...} Injectables).

@atscott atscott requested a review from AndrewKushnir Nov 5, 2019
@atscott atscott requested a review from angular/fw-core as a code owner Nov 5, 2019
@ngbot ngbot bot modified the milestone: needsTriage Nov 5, 2019
@googlebot googlebot added the cla: yes label Nov 5, 2019
Copy link
Contributor

AndrewKushnir left a comment

LGTM 👍 Thanks for fixing this @atscott.

This issue was found when debugging a test failure that was using lazy
loaded modules with the router. When doing this, the router calls
`NgModuleFactory.create` for the loaded module. This module gets a new
injector so the overrides provided in TestBed are not applied unless the
Injectable is in the providers list (which is not the case for
{providedIn...} Injectables).
@atscott atscott force-pushed the atscott:providedin branch from 039ad5d to 02cd95c Nov 5, 2019
@atscott

This comment has been minimized.

Copy link
Contributor Author

atscott commented Nov 5, 2019

Ivy presubmit
Should also run global presubmit

@atscott

This comment has been minimized.

Copy link
Contributor Author

atscott commented Nov 7, 2019

global presubmit

only regressions are e2e flakes that wouldn't be using TestBed

atscott added a commit that referenced this pull request Nov 7, 2019
…3606)

This issue was found when debugging a test failure that was using lazy
loaded modules with the router. When doing this, the router calls
`NgModuleFactory.create` for the loaded module. This module gets a new
injector so the overrides provided in TestBed are not applied unless the
Injectable is in the providers list (which is not the case for
{providedIn...} Injectables).

PR Close #33606
@atscott atscott closed this in 1ebe172 Nov 7, 2019
mohaxspb added a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
…gular#33606)

This issue was found when debugging a test failure that was using lazy
loaded modules with the router. When doing this, the router calls
`NgModuleFactory.create` for the loaded module. This module gets a new
injector so the overrides provided in TestBed are not applied unless the
Injectable is in the providers list (which is not the case for
{providedIn...} Injectables).

PR Close angular#33606
mohaxspb added a commit to mohaxspb/angular that referenced this pull request Nov 7, 2019
…gular#33606)

This issue was found when debugging a test failure that was using lazy
loaded modules with the router. When doing this, the router calls
`NgModuleFactory.create` for the loaded module. This module gets a new
injector so the overrides provided in TestBed are not applied unless the
Injectable is in the providers list (which is not the case for
{providedIn...} Injectables).

PR Close angular#33606
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

angular-automatic-lock-bot bot commented Dec 8, 2019

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 Dec 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.