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
Causes: Loop stopped without resolving promise or coroutine returned from test method
If you define the method mock which is yielded inside TestedClass to return a promise, it works.
Caused a fair bit of confusion writing tests, wouldn't mind an easier to understand error message if possible!
The text was updated successfully, but these errors were encountered:
Nessworthy
changed the title
Mocking a class without a mocked method that would normally return a promise causes the loop to stop without resolving the promise.
Mocking a class without a mocked method that would normally return a promise causes the loop to stop without resolving the test.
Feb 8, 2021
Nessworthy
changed the title
Mocking a class without a mocked method that would normally return a promise causes the loop to stop without resolving the test.
Mocking a class without a mocked method that would normally return a promise causes the loop to stop without resolving the test
Feb 8, 2021
I've noticed this problem, too, but I don't have any idea of how it could be solved. The auto-mocked promise is never resolved for obvious reasons; the desired behavior would be probably to auto-return Amp\Success(<auto-mocked "real" type>). But here we face two problems:
How to extend the behavior of standard PHPUnit mock generator?
For example:
Causes:
Loop stopped without resolving promise or coroutine returned from test method
If you define the method mock which is yielded inside
TestedClass
to return a promise, it works.Caused a fair bit of confusion writing tests, wouldn't mind an easier to understand error message if possible!
The text was updated successfully, but these errors were encountered: