From 4bd2802f8ebc42263a21151399e6ca28001a4689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= Date: Sun, 3 Dec 2017 21:54:18 +0100 Subject: [PATCH 1/2] docs: update expect.anything() example Fixes: https://github.com/facebook/jest/issues/4916 --- docs/ExpectAPI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ExpectAPI.md b/docs/ExpectAPI.md index 07bb4be5017b..9c108aa37e39 100644 --- a/docs/ExpectAPI.md +++ b/docs/ExpectAPI.md @@ -159,7 +159,7 @@ you want to check that a mock function is called with a non-null argument: ```js test('map calls its argument with a non-null argument', () => { const mock = jest.fn(); - [1].map(mock); + [1].map(x => mock(x)); expect(mock).toBeCalledWith(expect.anything()); }); ``` From bead4376e0acfe1ed95bc2c50b84aee2e7886c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= Date: Sun, 3 Dec 2017 22:20:52 +0100 Subject: [PATCH 2/2] changelog: update with #5007 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 968f63cea419..fc2f6c048665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,8 @@ alias. * `[docs]` Include missing dependency in TestEnvironment sample code * `[docs]` Add clarification for hook execution order +* `[docs]` Update `expect.anything()` sample code + ([#5007](https://github.com/facebook/jest/pull/5007)) ## jest 21.2.1