mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
fix: useUpdateEffect cleanup test returns false positive
This commit is contained in:
parent
c893fe36be
commit
9b31c42ccb
@ -13,7 +13,8 @@ it('should run effect on update', () => {
|
||||
|
||||
it('should run cleanup on unmount', () => {
|
||||
const cleanup = jest.fn();
|
||||
const hook = renderHook(() => useUpdateEffect(cleanup));
|
||||
const effect = jest.fn().mockReturnValue(cleanup);
|
||||
const hook = renderHook(() => useUpdateEffect(effect));
|
||||
|
||||
hook.rerender();
|
||||
hook.unmount();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user