Last active
August 29, 2015 14:23
-
-
Save cybersiddhu/ec1e7a4921883d46dc68 to your computer and use it in GitHub Desktop.
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/addons'; | |
const TestUtils = React.addons.TestUtils; | |
export default createComponent; | |
function createComponent(component, props, ...children) { | |
const shallowRenderer = TestUtils.createRenderer(); | |
shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0])); | |
return shallowRenderer.getRenderOutput(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment