Replies: 1 comment 4 replies
-
This is the first time I've heard that you can return a In the interface definition here it seems that it only supports |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm submitting a...
Current behavior
A component with
ngOnInit
that returns a promise functions as if it is not beingawait
ed whenspectator.detectChanges()
is called withdetectChanges: false
.Expected behavior
Any component with an
async
ngOnInit
is successfully handled by thespectator.detectChanges()
method.Minimal reproduction of the problem with instructions
For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://bit.ly/2zme3bj).
Steps:
this.loading = false
)The issue can be worked around either by calling
spectator.component.ngOnInit
orawait
ing a promise with a short timeout (e.g. 200ms).What is the motivation / use case for changing the behavior?
Angular supports async ngOnInit, so tests should too.
Environment
Beta Was this translation helpful? Give feedback.
All reactions