Created
January 9, 2017 08:19
-
-
Save Schubidu/acc10f2a1b0a720d5caa00e0f0bc873a to your computer and use it in GitHub Desktop.
jest snapshot snippet
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 renderer from 'react-test-renderer'; | |
export default (component) => { | |
const tree = renderer.create( | |
component | |
).toJSON(); | |
expect(tree).toMatchSnapshot(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment