Skip to content

Instantly share code, notes, and snippets.

@DinAlla
Created March 27, 2019 07:34
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/3d68b9ea2c07f130f49d4be4705286ef to your computer and use it in GitHub Desktop.
Save DinAlla/3d68b9ea2c07f130f49d4be4705286ef 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.pushState(
{},
'',
'/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