Skip to content

Commit 217e299

Browse files
committed
Moved cleanup definition in logs to match other API references
1 parent 73c1f61 commit 217e299

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/api-reference.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ This is the same [`act` function](https://reactjs.org/docs/test-utils.html#act)
108108

109109
## `cleanup`
110110

111+
```js
112+
function cleanup: Promise<void>
113+
```
114+
111115
Unmounts any rendered hooks rendered with `renderHook`, ensuring all effects have been flushed.
112116

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

120-
```js
121-
async function cleanup: void
122-
```
123-
124124
The `cleanup` function should be called after each test to ensure that previously rendered hooks
125125
will not have any unintended side-effects on the following tests.

0 commit comments

Comments
 (0)