Skip to content

Instantly share code, notes, and snippets.

@radzserg
Last active July 11, 2019 09:15
Show Gist options
  • Select an option

  • Save radzserg/7633082e3b58d0db4f89d36ca950f859 to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/7633082e3b58d0db4f89d36ca950f859 to your computer and use it in GitHub Desktop.
// 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