Skip to content

Instantly share code, notes, and snippets.

@pavermakov
Created April 27, 2020 07:51
Show Gist options
  • Save pavermakov/3e7a14a3efef7ef25cd9aab3a9cc27c8 to your computer and use it in GitHub Desktop.
Save pavermakov/3e7a14a3efef7ef25cd9aab3a9cc27c8 to your computer and use it in GitHub Desktop.
// Calling .blur() in the test renderer environment is not supported. Instead, mock out your
// components that use findNodeHandle with replacements that don't rely on the native environment.
jest.mock("TextInput", () => {
const RealComponent = require.requireActual("TextInput");
const React = require("react");
// eslint-disable-next-line react/prefer-stateless-function
class TextInput extends React.Component {
render() {
return React.createElement("TextInput", this.props, this.props.children);
}
}
TextInput.propTypes = RealComponent.propTypes;
return TextInput;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment