diff --git a/CHANGELOG.md b/CHANGELOG.md index bf56b3a9e0d5..60d469eae6f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - `[*]` Bump dated dependencies ([#6978](https://github.com/facebook/jest/pull/6978)) - `[scripts]` Don’t make empty subfolders for ignored files in build folder ([#7001](https://github.com/facebook/jest/pull/7001)) - `[docs]` Add missing export statement in `puppeteer_environment.js` under `docs/Puppeteer.md` ([#7127](https://github.com/facebook/jest/pull/7127)) +- `[docs]` Removed useless expect.assertions in `TestingAsyncCode.md` ([#7131](https://github.com/facebook/jest/pull/7131)) - `[docs]` Remove references to `@providesModule` which isn't supported anymore ([#7147](https://github.com/facebook/jest/pull/7147)) ## 23.6.0 diff --git a/docs/TestingAsyncCode.md b/docs/TestingAsyncCode.md index 3d795a014810..84e3beca9212 100644 --- a/docs/TestingAsyncCode.md +++ b/docs/TestingAsyncCode.md @@ -49,7 +49,6 @@ For example, let's say that `fetchData`, instead of using a callback, returns a ```js test('the data is peanut butter', () => { - expect.assertions(1); return fetchData().then(data => { expect(data).toBe('peanut butter'); }); @@ -73,7 +72,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'); }); ``` @@ -84,7 +82,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'); }); ``` @@ -114,12 +111,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'); }); ```