Skip to content

Commit

Permalink
Moved cleanup definition in logs to match other API references
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeyper committed Oct 14, 2019
1 parent 73c1f61 commit 217e299
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/api-reference.md
Expand Up @@ -108,6 +108,10 @@ This is the same [`act` function](https://reactjs.org/docs/test-utils.html#act)

## `cleanup`

```js
function cleanup: Promise<void>
```

Unmounts any rendered hooks rendered with `renderHook`, ensuring all effects have been flushed.

> Please note that this is done automatically if the testing framework you're using supports the
Expand All @@ -117,9 +121,5 @@ Unmounts any rendered hooks rendered with `renderHook`, ensuring all effects hav
> Setting the `RHTL_SKIP_AUTO_CLEANUP` environment variable to `true` before the
> `@testing-library/react-hooks` is imported will disable this feature.

```js
async function cleanup: void
```

The `cleanup` function should be called after each test to ensure that previously rendered hooks
will not have any unintended side-effects on the following tests.

0 comments on commit 217e299

Please sign in to comment.