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

Update include assertion docs for object properties #610

Merged
merged 1 commit into from
Feb 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,17 @@ module.exports = function (chai, _) {
/**
* ### .include(value)
*
* The `include` and `contain` assertions can be used as either property
* based language chains or as methods to assert the inclusion of an object
* in an array or a substring in a string. When used as language chains,
* they toggle the `contains` flag for the `keys` assertion.
* The `include` and `contain` assertions can be used as methods to assert
* the inclusion of a value in an array, a substring in a string, or a subset
* of properties in an object.
*
* expect([1,2,3]).to.include(2);
* expect('foobar').to.contain('foo');
* expect({ foo: 'bar', hello: 'universe' }).to.include({ foo: 'bar' });
*
* These assertions can also be used as property based language chains,
* enabling the `contains` flag for the `keys` assertion. For instance:
*
* expect({ foo: 'bar', hello: 'universe' }).to.include.keys('foo');
*
* @name include
Expand Down