-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
Consistency with returning new Assertion instead of this #791
Comments
Well noticed @meeber, thanks for the awesome job! 😄 |
Interestingly, I just discovered that this issue is blocking us from adding proxy support to overwritten properties. When a overwritten property returns |
Also, I've always wondered about this part of the logic: In what situation is |
Hey @vieiralucas welcome aboard! NOW FIX THIS! |
YES SIR! 😸 I'm still reading through all the issues and PR's involved in this issue. |
@vieiralucas This PR #642 has more details about it. I think this post explains the reason behind this whole thing, I highly recommend anyone involved with this issue to read that. |
A change was made a few months ago to return a new Assertion object with flags copied over instead of returning
this
. References: #562 #642However, it looks like there are still some spots where
this
is returned. The only one I've actually tested so far is overwriteProperty.For example:
As expected, the second assertion fails with error: "TypeError: expect(...).to.be.an.and.length.below is not a function" because the overwritten
and
is returning the function that was originally returned by the chainable methodan
instead of returning a new Assertion.Other places where this might be a problem (but I haven't tested):
The text was updated successfully, but these errors were encountered: