chaijs / chaijs.github.io

The chaijs.com website source code. Contributions welcome.
http://chaijs.github.io
49 stars 71 forks source link

Documentation on 'all' needs clarification #138

Closed dbooth-boston closed 8 years ago

dbooth-boston commented 8 years ago

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 commented 8 years ago

@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.