Files
react-native-gifted-chat/tests/context.js
Xavier Carpentier e0546481b3 Add Jest tests and Codecov reports (#673)
* chore(test): add jest

* chore(coverage): add codecov to circleci

* chore(vscode): remove vscode from git

* chore(test): snapshot all component
2017-12-20 10:53:33 -05:00

33 lines
684 B
JavaScript

/* eslint react/prop-types: 0, padded-blocks: 0 */
import 'react-native';
import React from 'react';
import renderer from 'react-test-renderer';
import PropTypes from 'prop-types';
class Context extends React.Component {
getChildContext() {
return {
actionSheet: () => {},
getLocale: () => 'en',
};
}
render() {
return this.props.children;
}
}
Context.propTypes = {
children: PropTypes.element,
};
Context.childContextTypes = {
actionSheet: PropTypes.func,
getLocale: PropTypes.func,
children: PropTypes.element,
};
export default function createComponentWithContext(children) {
return renderer.create(<Context>{children}</Context>);
}