From 6ebdd3dd44ab71160fd2d3d78a4a37ef4d4d3c5a Mon Sep 17 00:00:00 2001 From: Rikard Eide Date: Wed, 25 Jul 2018 16:06:18 +0200 Subject: [PATCH] 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)`. --- CHANGELOG.md | 1 + docs/ExpectAPI.md | 2 +- website/versioned_docs/version-23.3/ExpectAPI.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5687739574bb..6f7b768baabc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/docs/ExpectAPI.md b/docs/ExpectAPI.md index 72fcdedf793c..075ee7d2c8e8 100644 --- a/docs/ExpectAPI.md +++ b/docs/ExpectAPI.md @@ -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. diff --git a/website/versioned_docs/version-23.3/ExpectAPI.md b/website/versioned_docs/version-23.3/ExpectAPI.md index 1a466cd04d62..7b9ead1d9302 100644 --- a/website/versioned_docs/version-23.3/ExpectAPI.md +++ b/website/versioned_docs/version-23.3/ExpectAPI.md @@ -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.