Skip to content

Commit

Permalink
Docs/ExpectAPI: Correct docs for objectContaining (#6754)
Browse files Browse the repository at this point in the history
## Summary

Found an error in the docs for `expect.objectContaining(object)` describing what properties are matched by the method. The previous sentence seem to have been copy/pasted from `expect.not.objectContaining(object)`.
  • Loading branch information
rix1 authored and rickhanlonii committed Jul 25, 2018
1 parent 7caef39 commit 6ebdd3d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Fixes

- `[docs]` Update `expect.objectContaining()` description ([#6754](https://github.com/facebook/jest/pull/6754))
- `[babel-jest]` Make `getCacheKey()` take into account `createTransformer` options ([#6699](https://github.com/facebook/jest/pull/6699))
- `[docs]` Fix contributors link ([#6711](https://github.com/facebook/jest/pull/6711))
- `[website]` Fix website versions page to link to correct language ([#6734](https://github.com/facebook/jest/pull/6734))
Expand Down
2 changes: 1 addition & 1 deletion docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('not.stringMatching', () => {

### `expect.objectContaining(object)`

`expect.objectContaining(object)` matches any received object that recursively matches the expected properties. That is, the expected object is a **subset** of the received object. Therefore, it matches a received object which contains properties that are **not** in the expected object.
`expect.objectContaining(object)` matches any received object that recursively matches the expected properties. That is, the expected object is a **subset** of the received object. Therefore, it matches a received object which contains properties that **are present** in the expected object.

Instead of literal property values in the expected object, you can use matchers, `expect.anything()`, and so on.

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-23.3/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ describe('not.stringMatching', () => {

### `expect.objectContaining(object)`

`expect.objectContaining(object)` matches any received object that recursively matches the expected properties. That is, the expected object is a **subset** of the received object. Therefore, it matches a received object which contains properties that are **not** in the expected object.
`expect.objectContaining(object)` matches any received object that recursively matches the expected properties. That is, the expected object is a **subset** of the received object. Therefore, it matches a received object which contains properties that **are present** in the expected object.

Instead of literal property values in the expected object, you can use matchers, `expect.anything()`, and so on.

Expand Down

0 comments on commit 6ebdd3d

Please sign in to comment.