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
Would be cool if we could install spies before a component is initialized. I need to 'spy' on something that's called from ngOnInit. Best I can tell, I need to set detectChanges to false in the createFactoryComponent call, and then in most every test I end up having to do this:
This discussion was converted from issue #430 on May 12, 2021 15:27.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
-
I'm submitting a...
Current behavior
Would be cool if we could install spies before a component is initialized. I need to 'spy' on something that's called from
ngOnInit
. Best I can tell, I need to setdetectChanges
tofalse
in thecreateFactoryComponent
call, and then in most every test I end up having to do this:Expected behavior
Some way to specify the spies to be created before the
ngOnInit
call happens.What is the motivation / use case for changing the behavior?
Get rid of a bunch of boilerplate code
Environment
Beta Was this translation helpful? Give feedback.
All reactions