Skip to content

Instantly share code, notes, and snippets.

@DinAlla
Created March 27, 2019 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DinAlla/0f9ee18a6cb46c71a8db234493d36112 to your computer and use it in GitHub Desktop.
Save DinAlla/0f9ee18a6cb46c71a8db234493d36112 to your computer and use it in GitHub Desktop.
describe(ExampleComponent testing', () => {
test('should render correctly', () => {
const wrapper = shallow(
<ExampleComponent />
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
window.history.assign(‘/newPathname’);
const newWrapper = shallow(
<ExampleComponent />
);
expect(shallowToJson(newWrapper)).toMatchSnapshot();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment