Last active
October 11, 2018 00:30
-
-
Save lomse/5f5f86f7d2a9560b61c7c2f0f460fc13 to your computer and use it in GitHub Desktop.
Snapshot testing with Enzyme
This file contains hidden or 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 Enzyme, { shallow } from 'enzyme' | |
import Adapter from 'enzyme-adapter-react-16' | |
import TodoList from './TodoList' | |
describe('TodoList Component', () => { | |
beforeAll(() => { | |
Enzyme.configure({ adapter: new Adapter() }) | |
}) | |
it('renders correctly', () => { | |
const component = shallow(<TodoList />) | |
expect(component).toMatchSnapshot() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment