Skip to content
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

Property assertion fails when object has a field with undefined values #184

Closed
gamtiq opened this issue Jul 6, 2013 · 6 comments · Fixed by #308
Closed

Property assertion fails when object has a field with undefined values #184

gamtiq opened this issue Jul 6, 2013 · 6 comments · Fixed by #308

Comments

@gamtiq
Copy link

gamtiq commented Jul 6, 2013

First of all, thank you for the excellent library!
The following assertions will fail:

expect({a: undefined}).to.have.property("a");
expect({a: undefined}).to.have.property("a", undefined);
@molnarg
Copy link

molnarg commented Aug 21, 2013

+1, having a property should be tested with if (property in object) { ... }

@devand123
Copy link

#209

@sjberry
Copy link

sjberry commented Oct 21, 2014

New chai user here. Just ran into this issue. Is this waiting on a pull request?

@charlierudolph
Copy link

Yep. #210

@yelworc
Copy link

yelworc commented Nov 14, 2014

I just fell over the inverse, i.e. I expected this to fail:
assert.notProperty({prop: undefined}, 'prop');
As far as I can see, this is covered by the PR (please correct me if I'm wrong).

@keithamus
Copy link
Member

#210 needs to be updated, or a new PR made. @devand123 - do you have time to update #210 with the comments made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants