Last active
March 31, 2021 07:08
-
-
Save andirkh/2d12078d2ee2a161019386e882d52932 to your computer and use it in GitHub Desktop.
Minimum Viable Unit Test for React Container/Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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