From 3a8dc6aaf8ef7373879360d09e4897376bc0c011 Mon Sep 17 00:00:00 2001 From: Rikard Eide Date: Thu, 19 Jul 2018 22:38:53 +0200 Subject: [PATCH 1/2] Docs/ExpectAPI: Correct docs for `objectContaining` --- docs/ExpectAPI.md | 2 +- website/versioned_docs/version-23.3/ExpectAPI.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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. From 2f9e39915057bb0cf4be87bae27dcb0f569b839a Mon Sep 17 00:00:00 2001 From: Rikard Eide Date: Wed, 25 Jul 2018 09:05:17 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b346bd6d0d5..c205bc456f5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,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))