fix: useUpdateEffect cleanup test returns false positive

This commit is contained in:
Arnaud de Surirey 2020-01-07 19:34:57 +01:00
parent c893fe36be
commit 9b31c42ccb
No known key found for this signature in database
GPG Key ID: 1C7438F9FEF9D061

View File

@ -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();