diff --git a/docs/rules/prefer-expect-assertions.md b/docs/rules/prefer-expect-assertions.md index acca6055c..76dd9cfb9 100644 --- a/docs/rules/prefer-expect-assertions.md +++ b/docs/rules/prefer-expect-assertions.md @@ -69,3 +69,28 @@ When `true`, this rule will only warn for tests that use the `async` keyword. } } ``` + +When `asyncOnly` option is set to `true`, the following pattern would be a +warning: + +```js +test('my test', async () => { + const result = await someAsyncFunc(); + expect(result).toBe('foo'); +}); +``` + +While the following patterns would not be considered warnings: + +```js +test('my test', () => { + const result = someFunction(); + expect(result).toBe('foo'); +}); + +test('my test', async () => { + expect.assertions(1); + const result = await someAsyncFunc(); + expect(result).toBe('foo'); +}); +```