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

Documentation on 'all' needs clarification #138

Closed
dbooth-boston opened this issue Sep 9, 2016 · 1 comment
Closed

Documentation on 'all' needs clarification #138

dbooth-boston opened this issue Sep 9, 2016 · 1 comment

Comments

@dbooth-boston
Copy link

In http://chaijs.com/api/bdd/

.all
Sets the all flag (opposite of the any flag) later used by the keys assertion.
expect(foo).to.have.all.keys('bar', 'baz');

It is not clear whether 'all' means all-and-only. I.e., it is not clear whether: (a) foo is supposed to have keys 'bar' and 'baz' (but could also have key 'bof'); or (b) foo is suppose to have only keys 'bar' and 'baz' (as own properties).

@meeber
Copy link

meeber commented Sep 9, 2016

@dbooth-boston Thanks for helping with Chai. The behavior of all varies depending on if have or contains is present, as described here. Unlike all, most other flags are associated with multiple assertions, so details of a flag's behavior are typically located in the comments for the relevant assertion(s).

Any suggested improvements should be made in the code comments in the Chai repo, as the website documentation is automatically generated from that.

@meeber meeber closed this as completed Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants