ember-test-helpers icon indicating copy to clipboard operation
ember-test-helpers copied to clipboard

Allow `waitUntil` to accept a callback that returns a promise

Open boris-petrov opened this issue 2 years ago • 1 comments

Right now, waitUntil expects that the callback returns a truthy/falsy value. It would be nice to allow the callback to return a promise which resolves to a truthy/falsy value. So something like to work (and return after 1 second not immediately like now because the returned promise is a truthy value):

await waitUntil(() => new Promise((resolve) => setTimeout(() => resolve(true), 1000)));

boris-petrov avatar May 25 '23 10:05 boris-petrov

Thanks for this, @boris-petrov .

rishiraj88 avatar May 25 '23 12:05 rishiraj88