You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, MockComponent(s) mock all imports of the mocked component. With standalone components, this often means commonly used directives (NgIf) and modules (ReactiveFormsModules) are mocked. While in my tests, I don't want these mocked. I can work around this by adding the real directives/modules in Testbeds imports array.
I wish there was an option to just ignore the mocked component's imports, not import them at all. Something like: MockComponent(ChildComponent, { ignoreImports: true})
Since the mocked component itself won't be using them, this would keep my Testbed imports clean (and less searching for why my test does not work).
I wonder if other people are wanting this as well. Thanks a lot all!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, MockComponent(s) mock all imports of the mocked component. With standalone components, this often means commonly used directives (NgIf) and modules (ReactiveFormsModules) are mocked. While in my tests, I don't want these mocked. I can work around this by adding the real directives/modules in Testbeds imports array.
I wish there was an option to just ignore the mocked component's imports, not import them at all. Something like:
MockComponent(ChildComponent, { ignoreImports: true})
Since the mocked component itself won't be using them, this would keep my Testbed imports clean (and less searching for why my test does not work).
I wonder if other people are wanting this as well. Thanks a lot all!
Beta Was this translation helpful? Give feedback.
All reactions