-
Notifications
You must be signed in to change notification settings - Fork 3.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
expect(map).to.be.empty does not behave naturally #6072
Labels
Comments
This comes directly from Chai assertions and was not supported until Chai 4.0 as noted here: chaijs/chai#781 Support for asserting The code for this is done in #4270, but this has yet to be released. We'll update this issue and reference the changelog when it's released. |
Released in |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This test fails with the incorrect assertion: "expected {} not to be empty". It seems like Cypress is interpreting the Map object as some kind of DOM element, which it thinks is empty? Similarly, this test incorrectly passes if the
.not
is removed.Cypress doesn't explicitly say what it does for the
.empty
predicate in its assertions documentation but it does link to the full list of assertions which specify that for a Map, it will assert that the map has size 0. Even if the test code is changed toexpect(new Map([['a', 1]])).to.be.a('map').that.is.not.empty
the "empty" assertion is the one that fails.The text was updated successfully, but these errors were encountered: