fix: make negated `.keys` consider size of sets #924

Merged
merged 1 commit into from Mar 23, 2017

Conversation

Projects
None yet
4 participants
@meeber
Contributor

meeber commented Jan 30, 2017

When neither the contains nor any flags are set, the .keys
assertion implicitly means .all.keys and thus requires the target
and given sets to be the same size. Therefore, not.keys implicitly
means .not.all.keys, and should thus pass when the target and given
sets aren't the same size, even if the target set is a superset of the
given set. This commit enables this behavior.

Fixes #919

fix: make negated `.keys` consider size of sets
When neither the `contains` nor `any` flags are set, the `.keys`
assertion implicitly means `.all.keys` and thus requires the target
and given sets to be the same size. Therefore, `not.keys` implicitly
means `.not.all.keys`, and should thus pass when the target and given
sets aren't the same size, even if the target set is a superset of the
given set. This commit enables this behavior.
@lucasfcosta

This comment has been minimized.

Show comment
Hide comment
@lucasfcosta

lucasfcosta Feb 2, 2017

Member

LGTM!

Seems more straightforward this way. Good job!

Member

lucasfcosta commented Feb 2, 2017

LGTM!

Seems more straightforward this way. Good job!

@meeber

This comment has been minimized.

Show comment
Hide comment
@meeber

meeber Mar 22, 2017

Contributor

This is a small one. Pinging @keithamus @vieiralucas @shvaikalesh

Contributor

meeber commented Mar 22, 2017

This is a small one. Pinging @keithamus @vieiralucas @shvaikalesh

@vieiralucas

LGTM

@keithamus

This comment has been minimized.

Show comment
Hide comment
@keithamus

keithamus Mar 23, 2017

Member

Okay, happy enough with this given the context.

Member

keithamus commented Mar 23, 2017

Okay, happy enough with this given the context.

@keithamus keithamus merged commit 011612c into chaijs:master Mar 23, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@meeber meeber referenced this pull request Apr 23, 2017

Closed

Plugin issues with Chai v4 #890

@meeber meeber deleted the meeber:fix-not-have-keys branch Aug 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment