Skip to content

Instantly share code, notes, and snippets.

View vinayakhumberi's full-sized avatar
:octocat:

Vinayak Humberi vinayakhumberi

:octocat:
View GitHub Profile
jest.mock('react-redux', () => ({
connect: (mapStateToProps, mapDispatchToProps) => (reactComponent) => ({
mapStateToProps,
mapDispatchToProps: (dispatch = mockDispatch, ownProps) => mapDispatchToProps(dispatch, ownProps),
reactComponent,
mockDispatch: jest.fn((action) => action)
}),
Provider: ({children}) => children
}));