Created
March 4, 2020 08:39
-
-
Save rbinksy/d14e1c85c70c4e122bb5a48bc751040e to your computer and use it in GitHub Desktop.
This file contains 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'; | |
import { createStore } from 'redux'; | |
import { Provider } from 'react-redux'; | |
import { render } from '@testing-library/react'; | |
import reducer from '../../reducers'; | |
export const renderWithRedux = (component, initialState) => { | |
const store = createStore(reducer, initialState); | |
return { | |
...render(<Provider store={store}>{component}</Provider>), | |
store | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment