Skip to content

Commit 6ebdd3d

Browse files
rix1rickhanlonii
authored andcommitted
Docs/ExpectAPI: Correct docs for objectContaining (#6754)
## 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)`.
1 parent 7caef39 commit 6ebdd3d

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixes
88

9+
- `[docs]` Update `expect.objectContaining()` description ([#6754](https://github.com/facebook/jest/pull/6754))
910
- `[babel-jest]` Make `getCacheKey()` take into account `createTransformer` options ([#6699](https://github.com/facebook/jest/pull/6699))
1011
- `[docs]` Fix contributors link ([#6711](https://github.com/facebook/jest/pull/6711))
1112
- `[website]` Fix website versions page to link to correct language ([#6734](https://github.com/facebook/jest/pull/6734))

docs/ExpectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ describe('not.stringMatching', () => {
329329

330330
### `expect.objectContaining(object)`
331331

332-
`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.
332+
`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.
333333

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

website/versioned_docs/version-23.3/ExpectAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe('not.stringMatching', () => {
330330

331331
### `expect.objectContaining(object)`
332332

333-
`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.
333+
`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.
334334

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

0 commit comments

Comments
 (0)