-
Notifications
You must be signed in to change notification settings - Fork 28
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
Finally swallows rejections #49
Comments
I would submit a fix but I don't know how you want to update your custom test framework to also take into account the expected Promise result type. |
Thanks for your report. Sorry that I mistook how finally works. try {
try {
throw 'err'
} finally {
console.log('ok')
}
} catch (e) {
console.log(e)
} I thought the |
v0.18.1 published. If there's any problem, I will reopen this issue. |
@ysmood Thanks for the quick response! |
If I call
finally
on a rejected promise it unexpectedly becomes fulfilled.With yaku:
With bluebird:
Your
finally
test doesn't catch this because although you expect'error'
here: https://github.com/ysmood/yaku/blob/master/test/finally.js#L28You do not confirm that its a rejection here: https://github.com/ysmood/yaku/blob/master/test/testSuit.js#L14
The cause is that you do not rethrow or wrap
value
withPromise.reject
here:yaku/src/yaku.js
Line 154 in b5187ec
The text was updated successfully, but these errors were encountered: