Skip to content

Commit

Permalink
Update expect.assertions documentation (#11621)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Gentry <michael.gentry@seamlessleads.com>
  • Loading branch information
mgentry612 and michaelggentry committed Jul 2, 2021
1 parent edf2803 commit 7a64ede
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-27.0/ExpectAPI.md
Expand Up @@ -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();
Expand All @@ -415,7 +415,7 @@ test('doAsync calls both callbacks', () => {
expect(data).toBeTruthy();
}

doAsync(callback1, callback2);
await doAsync(callback1, callback2);
});
```

Expand Down

0 comments on commit 7a64ede

Please sign in to comment.