Closed doug-wade closed 6 years ago
After upgrading to 1.6.0, I'm getting a bunch of Possible Unhandled Promise Rejection: { Error: expect(received).toBe(expected)
in my Jest test suite too. I believe it's connected to the problem described by @doug-wade.
I'm going to merge this immediately and publish. Can you check if it works after?
@jefflau sure I'll test it first thing in the morning (CET). Thanks for your support š
Edit: 1.6.1 fixes the issue for me š thanks @jefflau.
hi there @jefflau! We got this updated today, and our CI build is happily passing. Thanks so much for your quick response!
I have some tests where I want to await the outcome of the results of fetch requests. The tests look like this
Note that I'm testing logic that does not return the promise, so I can't await it directly. Instead, I rely on the fact that the mock will resolve on next tick, and await
setImmediate
to wait for the next tick before making my assertions. This worked great, but it seems that the new Promise polyfill introduced in this PR has broken this behavior (afaict, since it also usessetImmediate
as well, we can no longer be certain that has been resolved before our setImmediate. I'm a little hazy on the detail, though, as I haven't spelunked very far into the implementations of the promise polyfill).