-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversion of non-promises to promises is problematic for AVA #2
Comments
I thought it was a good idea when I merged #1, but I noticed the issue with AVA too a while ago. Do you have any suggested solution other than reverting? // @mastilver |
the Promise.resolve is just there if you pass something which is not an observable We could just check if the arg is not an If you are happy with that, I will create a PR in 5-6 hours |
Or we could only support then you won't be able to do:
will throw |
My only other thought was to throw a TypeError, if they pass a non observable. It would require AVA do an |
I'm happy with that |
👍 |
Observable `0.2.0`/`0.3.0` introduced some breaking changes. Namely, it now throws if passed a non-observable. Reference: sindresorhus/observable-to-promise#2
#1 Causes every argument to be converted to a via
Promise.resolve()
. That creates a small problem for AVA, since this line expectsisPromise(fn)
to be false if afunction
was passed in.Also, the current behavior creates ambiguity, as:
Produces an identical result to:
The text was updated successfully, but these errors were encountered: