Skip to content

Commit

Permalink
Merge pull request #197 from kahwee/patch-1
Browse files Browse the repository at this point in the history
Add { act } to be part of import
  • Loading branch information
mpeyper committed Oct 12, 2019
2 parents 28ee690 + 3889e23 commit f343e59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/usage/advanced-hooks.md
Expand Up @@ -36,7 +36,7 @@ export function useCounter(initialValue = 0) {
In our test, we simply use `CounterStepProvider` as the `wrapper` when rendering the hook:

```js
import { renderHook } from '@testing-library/react-hooks'
import { renderHook, act } from '@testing-library/react-hooks'
import { CounterStepProvider, useCounter } from './counter'

test('should use custom step when incrementing', () => {
Expand Down Expand Up @@ -72,7 +72,7 @@ file:
```js
/* eslint-disable react/display-name */

import { renderHook } from '@testing-library/react-hooks'
import { renderHook, act } from '@testing-library/react-hooks'
import { CounterStepProvider, useCounter } from './counter'

test('should use custom step when incrementing', () => {
Expand Down Expand Up @@ -118,7 +118,7 @@ export function useCounter(initialValue = 0) {
To test `incrementAsync` we need to `await waitForNextUpdate()` before the make our assertions:

```js
import { renderHook, act } from '@testing-library/react-hooks'
import { renderHook } from '@testing-library/react-hooks'
import { useCounter } from './counter'

test('should increment counter after delay', async () => {
Expand Down

0 comments on commit f343e59

Please sign in to comment.