-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
thenReject causes UnhandledPromiseRejectionWarning #238
Comments
Looks like swallowing errors in thenReject: function (errorOrMessage) {
const promise = Promise.reject(getError(errorOrMessage))
promise.catch((error) => {/* this error is swallowed to prevent failing tests in strict environment */})
return finishPendingExpectation(promise, pendingExpectation);
} |
Hey @iLikeKoffee, happy to hear you'r finding the lib useful so far :) In your test example above you're mocking I'm actually in the process of making I'll leave the issue open until I finish the above, but just wanted to clarify that your test example is supposed to fail because the expectation is not met. |
Yes, my code has rejection handler. But As far as I understand mechanics of Thank you for quick response! |
Hey @iLikeKoffee, this should now be fixed in 7.1.0. |
Sorry, I have written comment, and forgot to submit it a year ago. Thank you so much, works like a charm! |
Hello. First of all - thank you for awesome tool! I enjoy working with it every time!
There is some trouble with testing service rejections. See:
this results
And sometimes it causes test failures (jest + new versions react testing library has stricter promise rejection policies, if there is a rejected promise in queue - test fails)
So, i have to do something like this:
And this helps me to get my tests passed.
I will be glad to provide any needed assistance to fix that if needed.
Have a nice day!
The text was updated successfully, but these errors were encountered: