-
Notifications
You must be signed in to change notification settings - Fork 69
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
improve to.have.text assertion message for nested elements #42
improve to.have.text assertion message for nested elements #42
Conversation
Can you please spell out the issue you're trying to fix? Is it that failure messages print the jQuery selection as |
Yeah, exactly that, look at this: http://jsfiddle.net/rafmagana/V34cb/2/ I think assertion errors should be more descriptive, at least the errors for
actually, I'd planned to add:
but found the former more explicit. I see the same problem with other assertion errors (like I didn't find a better way to do it, where would you recommend to fix this? I'll do it. Jus let me know. |
Bump |
|
I'd like to weigh in as well - that's quite annoying that a lot of chai-jquery matchers in case of failure return message that can't help in understanding why assertion failed. This .text() is one of such examples. That's why in our team we try to use |
Hmm, I actually can't reproduce the problem. I applied this diff, and the test still passes:
This is with jQuery 2.1.0 and chai 1.9.0. |
Okay, I see what's going on. Chai's |
@theghostbel yes, but that defeats the purpose of chai-jquery, I was doing the same as you, but I think we should fix it. @jfirebaugh Ok, gotcha, but I don't think this bug has to do with that, because the error I'm having is not shown as |
@jfirebaugh actually, I take that back, looks like 40-chars limitation is the problem, so, you're right, this is not a chai-jquery problem but chais itself. Closing this issue. |
Chai's If anyone is willing, a PR for Chai in this regard will see fast inclusion. |
@logicalparadox @jfirebaugh So the logic would be something along these lines?
is that so? |
I'm thinking you extract this conditional, export it as |
No description provided.