emberjs / emberjs/ember-test-helpers

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

Open
#1,393 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
188
Forks
254
PR merge metrics
No merged PRs in 30d

Description

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):

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.