Nicolò Ribaudo b9ea196259
Await promises from sync iterators with for-await (#13824)
Co-authored-by: Mickey Rose <lightmare@users.noreply.github.com>
2021-10-07 23:57:25 +02:00

8 lines
186 B
JavaScript

async function* fn() {
yield* [Promise.resolve("ok")] // CreateAsyncFromSyncIterator
}
return fn().next().then(result => {
expect(result).toEqual({ value: "ok", done: false });
});