Skip to content

Commit f846c4d

Browse files
Kent C. Doddsgaearon
Kent C. Dodds
authored andcommitted
react-testing-library now supports act (#1635)
* react-testing-library now supports `act` * fix typo
1 parent 2a5b6cc commit f846c4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/blog/2019-02-06-react-v16.8.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Even while Hooks were in alpha, the React community created many interesting [ex
5050

5151
## Testing Hooks
5252

53-
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries like [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) can also wrap their APIs with it.
53+
We have added a new API called `ReactTestUtils.act()` in this release. It ensures that the behavior in your tests matches what happens in the browser more closely. We recommend to wrap any code rendering and triggering updates to your components into `act()` calls. Testing libraries can also wrap their APIs with it (for example, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)'s `render` and `fireEvent` utilities do this).
5454

5555
For example, the counter example from [this page](/docs/hooks-effect.html) can be tested like this:
5656

0 commit comments

Comments
 (0)