Last active
July 11, 2019 09:15
-
-
Save radzserg/7633082e3b58d0db4f89d36ca950f859 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
| // now I wanna make a snapshot testing | |
| it("renders home page", () => { | |
| const push = jest.fn() | |
| const mockHistory = { push } as unknown as History; | |
| const page = mount( | |
| <HomePage history={mockHistory}/> | |
| ); | |
| expect(page).toMatchSnapshot(); | |
| // when you need to test a push | |
| // expect(push).toHaveBeenCalledWith("/catalog"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment