File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export function useCounter(initialValue = 0) {
36
36
In our test, we simply use ` CounterStepProvider ` as the ` wrapper ` when rendering the hook:
37
37
38
38
``` js
39
- import { renderHook } from ' @testing-library/react-hooks'
39
+ import { renderHook , act } from ' @testing-library/react-hooks'
40
40
import { CounterStepProvider , useCounter } from ' ./counter'
41
41
42
42
test (' should use custom step when incrementing' , () => {
72
72
``` js
73
73
/* eslint-disable react/display-name */
74
74
75
- import { renderHook } from ' @testing-library/react-hooks'
75
+ import { renderHook , act } from ' @testing-library/react-hooks'
76
76
import { CounterStepProvider , useCounter } from ' ./counter'
77
77
78
78
test (' should use custom step when incrementing' , () => {
@@ -118,7 +118,7 @@ export function useCounter(initialValue = 0) {
118
118
To test ` incrementAsync ` we need to ` await waitForNextUpdate() ` before the make our assertions:
119
119
120
120
``` js
121
- import { renderHook , act } from ' @testing-library/react-hooks'
121
+ import { renderHook } from ' @testing-library/react-hooks'
122
122
import { useCounter } from ' ./counter'
123
123
124
124
test (' should increment counter after delay' , async () => {
You can’t perform that action at this time.
0 commit comments