From 7a64ede2163eba4ecc725f448cd92102cd8c14aa Mon Sep 17 00:00:00 2001 From: Michael Gentry <55594808+mgentry612@users.noreply.github.com> Date: Fri, 2 Jul 2021 01:45:32 -0400 Subject: [PATCH] Update expect.assertions documentation (#11621) Co-authored-by: Michael Gentry --- CHANGELOG.md | 6 ++++++ website/versioned_docs/version-27.0/ExpectAPI.md | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a3578e203f1..a6b1d88a6a8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ ### Performance +## 27.0.7 + +### Chore & Maintenance + +- `[docs]` Correct expects.assertions documentation by adding async/await for asynchronous function. + ## 27.0.6 ### Fixes diff --git a/website/versioned_docs/version-27.0/ExpectAPI.md b/website/versioned_docs/version-27.0/ExpectAPI.md index 43a39820e975..9503a3f029c6 100644 --- a/website/versioned_docs/version-27.0/ExpectAPI.md +++ b/website/versioned_docs/version-27.0/ExpectAPI.md @@ -406,7 +406,7 @@ describe('Beware of a misunderstanding! A sequence of dice rolls', () => { For example, let's say that we have a function `doAsync` that receives two callbacks `callback1` and `callback2`, it will asynchronously call both of them in an unknown order. We can test this with: ```js -test('doAsync calls both callbacks', () => { +test('doAsync calls both callbacks', async () => { expect.assertions(2); function callback1(data) { expect(data).toBeTruthy(); @@ -415,7 +415,7 @@ test('doAsync calls both callbacks', () => { expect(data).toBeTruthy(); } - doAsync(callback1, callback2); + await doAsync(callback1, callback2); }); ```