-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
contains
does not fail on string input
#145
Comments
hmm. I'd expect the following behavior: shallow(<div>foo</div>).contains('foo'); //=> true
shallow(<div>foo</div>).contains('bar'); //=> false and I assume that you're saying the second statement returns true as well, right? |
fix #145 `contains` does not fail on string input
I'm not sure that we need to update docs. It's expected behavior. |
Hm, maybe I misunderstand the docs then. The signature is:
But, |
Strings and numbesr are "nodes". Also it's valid JSX expression. But of course let maintainers decide. |
The API for
contains()
clearly indicates that it should be provided a node, and yet if a string is provided instead, it seems that it will returntrue
, no matter the string. I would have expected an error to be thrown, or at least thatfalse
would be returned.The text was updated successfully, but these errors were encountered: