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) {
3636In our test, we simply use ` CounterStepProvider ` as the ` wrapper ` when rendering the hook:
3737
3838``` js
39- import { renderHook } from ' @testing-library/react-hooks'
39+ import { renderHook , act } from ' @testing-library/react-hooks'
4040import { CounterStepProvider , useCounter } from ' ./counter'
4141
4242test (' should use custom step when incrementing' , () => {
7272``` js
7373/* eslint-disable react/display-name */
7474
75- import { renderHook } from ' @testing-library/react-hooks'
75+ import { renderHook , act } from ' @testing-library/react-hooks'
7676import { CounterStepProvider , useCounter } from ' ./counter'
7777
7878test (' should use custom step when incrementing' , () => {
@@ -118,7 +118,7 @@ export function useCounter(initialValue = 0) {
118118To test ` incrementAsync ` we need to ` await waitForNextUpdate() ` before the make our assertions:
119119
120120``` js
121- import { renderHook , act } from ' @testing-library/react-hooks'
121+ import { renderHook } from ' @testing-library/react-hooks'
122122import { useCounter } from ' ./counter'
123123
124124test (' should increment counter after delay' , async () => {
You can’t perform that action at this time.
0 commit comments