Open brinehart opened 2 years ago
AFAIK- toPromise
waits for the observable to be completed before resolving.
nextWith
keeps the observable open.
Try using nextOneTimeWith
instead, as it completes after sending the value.. it should solve your issue
Let me know if you run into any other issues
@brinehart Did you have success with the suggested solution/other feedback?
If not I suggest closing this issue now.
Describe the bug When .toPromise is called on a spied on method with a .nextWith the code stops execution
To Reproduce Steps to reproduce the behavior:
await <<spy>>.<<method>>.toPromise()
inside an async methodExpected behavior When called as toPromise() the observable should be cast as a Promise and when awaited should return the current value. Then jest debugger should not stop execution of the method and continue stepping through the code on the next line.
Screenshots
Desktop (please complete the following information):
Additional context Package json version info: