Closed
Description
Hello,
Take the following example:
await Promise.all([
waitFor(() =>
expect(getByText('first-item')).toBeTruthy()
),
waitFor(() =>
expect(getByText('second-item')).toBeTruthy()
),
]);
This is flagged up as an error: "Promise returned from waitFor
must be handled", which I believe is a false positive, as the Promise is indeed being handled by the Promise.all.
Thanks
Activity
gndelia commentedon Sep 8, 2020
Hi Mikey!
If you are waiting for of those two to appear, perhaps you could consider
findByText
as an alternativeAs of the code itself, yeah it sounds like a bug
Thanks for opening the ticket!
Mikeysauce commentedon Sep 8, 2020
Thanks gndelia,
I'm in agreement with you regarding findBy being more suitable here with it having a built in waitFor behaviour, but some colleagues find the intent of waitFor to be more explicit and so here we are unfortunately. I appreciate the quick reply!
fix(await-async-utils): consider promise.all (#236)
Belco90 commentedon Oct 12, 2020
🎉 This issue has been resolved in version 3.9.1 🎉
The release is available on:
Your semantic-release bot 📦🚀