-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
{ shallow: true } doesn't mock standalone components/directives/pipes #628
Comments
Have the same issue. Angular version: |
I have the same issue with Angular 16.2, spectator 14.0.0 |
Until this gets rectified, here is a (hopefully temporary?) solution:
This relies on ng-mocks, but that part is easily changed to whatever implementation you wish to use. |
Any update on this? I feel this would make the migration to standalone components significantly easier. I also think its fair to assume shallow: true would mock imports of a standalone component. Seeing as this is the direction angular wants us to go, I feel this should be a pretty high value fix. |
Hi, you're welcome to create a PR |
Description
If you add the setting { shallow: true } to the createComponentFactory function, it normally mocks all components, directives, pipes that are in the template, which is awesome.
However, it doesn't do this for standalone components, directives, pipes and I think that it should.
Is this something that can be addressed?
Proposed solution
For this setting to work for both "old style" and standalone components/directives/pipes
Alternatives considered
Do you want to create a pull request?
No
The text was updated successfully, but these errors were encountered: