Skip to content

Instantly share code, notes, and snippets.

@hdsenevi
Created December 10, 2018 11:11
Show Gist options
  • Save hdsenevi/04512d1c29387f1d447e6b971ebc073a to your computer and use it in GitHub Desktop.
Save hdsenevi/04512d1c29387f1d447e6b971ebc073a to your computer and use it in GitHub Desktop.
Article helper gist for "Unit testing in React Native with Jest and Enzyme" (https://github.com/hdsenevi/react-native-unit-testing-recipes)
import React from 'react';
import {shallow} from 'enzyme';
import Button from './Button';
describe('Button', () => {
describe('Rendering', () => {
it('should match to snapshot', () => {
const component = shallow(<Button label="test label"/>)
expect(component).toMatchSnapshot()
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment