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

Bug: Provider imported by module is deleted if submodule does not provide it #4613

Closed
GabrielKatz opened this issue Jan 3, 2023 · 2 comments · Fixed by #4628
Closed

Bug: Provider imported by module is deleted if submodule does not provide it #4613

GabrielKatz opened this issue Jan 3, 2023 · 2 comments · Fixed by #4628
Assignees
Labels
bug Something isn't working released v14.5.2

Comments

@GabrielKatz
Copy link

Description of the bug

Say we have a module X, and a module Y with a dependency on X. In the testing module, X is imported with some providers in the testing module, in module Y it is not. Consequently, the providers should be available in the testing module. But now, say we have a combination of real components and fake components (so that the "magic" in

// We should do magic only then both mock and real exist.
is applied). Then the provider is not available anymore in v14.5.1, but was in v14.5.0.

An example of the bug

Link: https://stackblitz.com/edit/angular-ivy-fgudvv?file=src%2Fapp%2Fapp.component.spec.ts

Expected vs actual behavior

Expected behavior: FooComponent can be created.

Actual behavior: FooComponent cannot be created because no provider for MyService is found.

@GabrielKatz GabrielKatz added the bug Something isn't working label Jan 3, 2023
@satanTime
Copy link
Member

Hi @GabrielKatz,

thank you for the report. On it!

satanTime added a commit that referenced this issue Jan 6, 2023
fix(MockBuilder): imports modules with providers on root level #4613
@satanTime
Copy link
Member

v14.5.2 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released v14.5.2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants