Skip to content

Instantly share code, notes, and snippets.

@andirkh
Last active March 31, 2021 07:08
Show Gist options
  • Save andirkh/2d12078d2ee2a161019386e882d52932 to your computer and use it in GitHub Desktop.
Save andirkh/2d12078d2ee2a161019386e882d52932 to your computer and use it in GitHub Desktop.
Minimum Viable Unit Test for React Container/Component
import React from 'react';
import { shallow } from 'enzyme';
import ContainerName from '#containers/ContainerName';
describe('<ContainerName />', () => {
let wrapper;
beforeEach(() => {
wrapper = shallow(<ContainerName />);
});
afterEach(() => {
wrapper && wrapper.unmount();
});
it('should render <ContainerName />', () => {
expect(wrapper.exists()).toBe(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment