@@ -64,13 +64,13 @@ const useTheme = (initialTheme) => {
64
64
}
65
65
66
66
// useTheme.test.js
67
- import { testHook , cleanup , act } from ' react-hooks-testing-library'
67
+ import { renderHook , cleanup , act } from ' react-hooks-testing-library'
68
68
69
69
describe (' custom hook tests' , () => {
70
70
afterEach (cleanup)
71
71
72
72
test (' should use theme' , () => {
73
- const { result } = testHook (() => useTheme (' light' ))
73
+ const { result } = renderHook (() => useTheme (' light' ))
74
74
75
75
const theme = result .current
76
76
@@ -79,7 +79,7 @@ describe('custom hook tests', () => {
79
79
})
80
80
81
81
test (' should update theme' , () => {
82
- const { result } = testHook (() => useTheme (' light' ))
82
+ const { result } = renderHook (() => useTheme (' light' ))
83
83
84
84
const { toggleTheme } = result .current
85
85
@@ -101,7 +101,7 @@ describe('custom hook tests', () => {
101
101
< ThemesContext .Provider value= {customThemes}> {children}< / ThemesContext .Provider >
102
102
)
103
103
104
- const { result } = testHook (() => useTheme (' light' ), { wrapper })
104
+ const { result } = renderHook (() => useTheme (' light' ), { wrapper })
105
105
106
106
const theme = result .current
107
107
0 commit comments