Created
May 9, 2020 05:49
-
-
Save mikekoro/0a0575c3036580885b270b9a547b184c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { act, renderHook } from '@testing-library/react-hooks'; // Don't forget to install this package | |
import { useValue } from "./useValue"; | |
it("Custom hook hooks:)", () => { | |
const { result } = renderHook(useValue); | |
act(() => { | |
result.current.assignValue('Hello World'); | |
}); | |
expect(result.current.value).toBe('Hello World'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment