Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expect.assertions documentation #11621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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