-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Promise.map unhandled rejections (#1487) #1489
Fix Promise.map unhandled rejections (#1487) #1489
Conversation
239664f
to
3bb03d0
Compare
Can you add tests? What about two rejections in a single array? |
Would be happy to write tests, but can you advise how to write a test for an unhandled rejection? By it's nature it's hard to test for. 2 rejections in a single array should also be handled as iteration over the array now happens synchronously. |
@benjamingr Tests added. I've used |
NB The test also covers case of 2 rejections in an array. |
This PR fixes #1487.
Previously, unhandled rejection errors can occur with
Promise.map()
,Promise.filter()
,.map()
and.filter()
when in fact the rejections are handled.Prior to this PR, all of the following create an unhandled rejection, after this PR they do not.
I have not written tests as I'm not sure how to test for unhandled rejections.