Skip to content

Instantly share code, notes, and snippets.

@Eightyplus
Created November 12, 2018 08:46
Show Gist options
  • Save Eightyplus/5a5d3d464fac74a9456613d31b66cb9d to your computer and use it in GitHub Desktop.
Save Eightyplus/5a5d3d464fac74a9456613d31b66cb9d to your computer and use it in GitHub Desktop.
mock named exports, in this case `createFragmentContainer` and `withRouter`
jest.mock('react-relay', () => ({
createFragmentContainer: Component => props => <Component {...props} />
}));
jest.mock('react-router', () => ({
withRouter: Component => props => <Component {...props} />
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment