-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
.empty fails for mongoose arrays #537
Comments
Hey @tusbar thanks for the issue. This is probably because the array has some keys assigned to it. What do you get back from |
@keithamus it does have keys as it is not a real Array, but it implements the Array API (or at least some of it).
|
Okay, so its not empty then? In that case, Is your issue that the message isn't good enough? I guess it should say something like |
@keithamus the issue is that this used to work pre-3.3.0. And it is a breaking change. I am sure that many people use chai and mongoose together and will pull their hair out trying to understand what’s going on (especially with that I seems that you want |
Also @tusbar - if you get a PR done ASAP I can cut a release today |
The change introduced in chaijs#499 breaks compatibility with Array-like objects (e.g. mongoose arrays). It should be applied in the next major version. Fix chaijs#537
The change introduced in chaijs#499 breaks compatibility with Array-like objects (e.g. mongoose arrays). It should be applied in the next major version. Fix chaijs#537
Hey,
The new
.empty
assertion that was introduced in #499 fails for mongoose arrays.You can reproduce with the following:
It fails with a
AssertionError: expected [] to be empty
.I am using mongoose @
4.1.12
but I’m not sure that’s relevant to the issue.The text was updated successfully, but these errors were encountered: