Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save alanbsmith/6fcb82ec2d9472a8d2191cb0ac249cb0 to your computer and use it in GitHub Desktop.

Select an option

Save alanbsmith/6fcb82ec2d9472a8d2191cb0ac249cb0 to your computer and use it in GitHub Desktop.
effective-testing-for-styled-components-simple-button-enzyme-test
import { shallow } from ‘enzyme’;
import expect from ‘expect’
import enzymify from ‘expect-enzyme’
expect.extend(enzymify())
describe(‘Button Component’, () => {
it(‘renders a button element’, () => {
const wrapper = shallow(Button);
// this test is basically worthless
expect(wrapper).toBeA(‘button’);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment