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

removed useless expect.assertions #7131

Merged
merged 3 commits into from
Oct 13, 2018
Merged
Changes from 1 commit
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
4 changes: 0 additions & 4 deletions docs/TestingAsyncCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ You can also use the `.resolves` matcher in your expect statement, and Jest will

```js
test('the data is peanut butter', () => {
expect.assertions(1);
return expect(fetchData()).resolves.toBe('peanut butter');
});
```
Expand All @@ -84,7 +83,6 @@ If you expect a promise to be rejected use the `.rejects` matcher. It works anal

```js
test('the fetch fails with an error', () => {
expect.assertions(1);
return expect(fetchData()).rejects.toMatch('error');
});
```
Expand Down Expand Up @@ -114,12 +112,10 @@ Of course, you can combine `async` and `await` with `.resolves` or `.rejects`.

```js
test('the data is peanut butter', async () => {
expect.assertions(1);
await expect(fetchData()).resolves.toBe('peanut butter');
});

test('the fetch fails with an error', async () => {
expect.assertions(1);
await expect(fetchData()).rejects.toThrow('error');
});
```
Expand Down