-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Should it be possible to overwrite a chainable method? #215
Comments
This is currently not implemented but I think it would be a good idea. Can it look like this: Assertion.overwriteChainableMethod('length', {
method: function(_super) {
return function() {};
},
chain: function(_super) {
return function() {};
}
}); Might be difficult to separate the chain _super from the method _super with the current way things are done. Open to ideas or PRs... |
Hoo boy. I'm beginning to see why this is difficult. This pull request is going to involve some pretty terrifying code, but at least it'll be a jumping-off point for discussion, I hope. |
Looking forward to it! |
I was trying to add some custom behavior to the
length
assertion, when I noticed thatoverwriteMethod
doesn't seem work on chainable methods.Is this by design? Am I missing something fundamental here? Or should there be code in the chai plugin API to let you do something like this:
Feel free to tell me to write a pull request, just wondering if it's worth my time. Anyway, thanks very much for this library; it's pretty awesome. :)
The text was updated successfully, but these errors were encountered: