-
Notifications
You must be signed in to change notification settings - Fork 14
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
Breaks Chai all.keys #24
Comments
Hey @ThomWright thanks for the issue. This does seem to be a problem. I'd welcome a PR to fix this if you have the time 😄 |
This is sad :( |
PR sent. The Travis build failed, but it seems to be because it hasn't been configured and is trying to build a Ruby project. |
This might be a breaking change, but perhaps instead of using the word all, you use the word each. expect(collection).to.each.have.property("foo", "bar") instead of expect(collection).to.each.have.property("foo", "bar") This makes more sense grammatically as well. |
👍 That would probably be a better solution. |
I’ve exactly the same problem. The |
I agree that each is more intuitive than all, seems like a decent idea. You could even make it work for object values. A workaround for this is omit writing "all", since chai defaults to using it anyway. From the chai docs:
|
I tried to fix this. I might have gotten a bit overaggressive with it though. Side effects include allowing testing over enumerable object properties |
Nice! |
Get unexcited. It's clear there are some implementation decisions in this module which are at odds with the chai implementations. The 'contains' flag interaction is mandatory for 'any' and has no effect on 'all' however in default chai the behavior is There is also a difference between the included chai package and most up to date package of chai. |
Okay. It's ready again. Whew. |
I would like to ask for news of the issue ^^ |
Seems it doesn't work at all. |
It's pretty bad that this is 4+ years old. Just used |
If they aren't going to maintain this plugin it needs to be marked as archived and alternatives given for its use cases. |
Sadly the broken example of this still exists in the Chai documentation: |
Chai's built-in
all.keys
assertions seem to break when I usechai-things
- Chai keysAssertionError: expected { Object (a, b, ...) } to have a property 'length'
The text was updated successfully, but these errors were encountered: