Skip to content

Commit

Permalink
fix: useUpdateEffect test returning false positive (#865)
Browse files Browse the repository at this point in the history
fix: useUpdateEffect test returning false positive
  • Loading branch information
streamich authored Jan 8, 2020
2 parents de3e711 + 9b31c42 commit 1946006
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/useUpdateEffect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1946006

Please sign in to comment.