score:43
Accepted answer
Try registering redux-thunk
middleware with your redux-mock-store
so that the tests are aware of the async middleware you are using in your actual store is using:
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)
Hopefully that helps!
Source: stackoverflow.com
Related Query
- Unit test: Actions must be plain objects. Use custom middleware for async actions
- Use custom middleware for async actions. Actions must be plain objects
- React-Redux: Actions must be plain objects. Use custom middleware for async actions
- CreateAsyncThunk Error: Actions must be plain objects. Use custom middleware for async actions
- React-Redux-Saga: Actions must be plain objects. Use custom middleware for async actions
- React-Redux - Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions
- React-Redux: Actions must be plain objects. Use custom middleware for async actions Error
- Actions must be plain objects. Use custom middleware for async actions.how to solve this
- react-redux Error: Actions must be plain objects. Use custom middleware for async actions
- Redux Actions must be plain objects. Use custom middleware for async actions
- Redux Error Actions must be plain objects. Use custom middleware for async actions
- React Redux Saga: Actions must be plain objects. Use custom middleware for async actions
- redux-observable + socket.io: Actions must be plain objects. Use custom middleware for async actions
- Redux thunk - Error ยท Actions must be plain objects. Use custom middleware for async actions even with dispatch an object with key type
- Error: Actions must be plain objects. Use custom middleware for async actions.
- Actions must be plain objects. Use custom middleware for async actions - Lost Here
- Actions must be plain objects. Use custom middleware for async actions
- How to fix: Error: Actions must be plain objects. Use custom middleware for async actions.?
- Redux-Thunk Error: Actions must be plain objects. Use custom middleware for async actions
- Redux error: Actions must be plain objects. Use custom middleware for async actions
- Problem with redux middleware - Error: Actions must be plain objects. Use custom middleware for async actions
- Error: Actions must be plain objects. Use custom middleware for async actions. But I don`t have async functions
- React/Redux: Error: Actions must be plain objects. Use custom middleware for async actions
- React-Reudx: Actions must be plain objects. Use custom middleware for async actions
- redux-observable: Actions must be plain objects. Use custom middleware for async actions
- Actions must be plain objects. Use custom middleware for async actions Saga thunk I do have so far in my store
- I'm using a useDispatch custom hook and getting this error in my test: Actions must be plain objects. Use custom middleware for async actions
- Error: Actions must be plain objects. Use custom middleware for async actions. React-redux error
- Actions must be plain objects. Use custom middleware for async actions. by using middleware
- How to fix the bug React-Redux: Actions must be plain objects. Use custom middleware for async actions? I need clarity on the same
More Query from same tag
- Login page with express and create-react-app
- Setting default context in React
- React issue when tryign to play mp3
- ServiceWorker Push Notification options not passing to notification
- onClick={OnButtomSubmit} function not working in ReactJs
- Responsive Props In ReactJS Styled Components
- Displaying data from the database (MERN)
- Cannot use token from localstorage in React
- Passing updated state as props
- Sorting Firestore result alternatives
- How to update props dependent state
- What is the best place to pull data from query string, then call API and render components?
- You may need an appropriate loader to handle this file type. with webpack
- Normalizr - not resulting expected
- "ComponentDidMount" hook triggers memory-leaks if i'm requesting data from the server
- why my redux state not updating
- How to change only the one value of a object in a state
- React - Infinite scroll - scroll doesn't appear when open the application in big screen like TV/projector
- AWS AppSync, how to send an email after a mutation?
- Undefined parameter in react component
- Styling react component in styled components
- React-table date range filter
- How to import vaadin-icon into React component?
- react push unique objects in array
- How to send value from one component, to another
- React PropTypes.oneOf to specify an enum doesn't work
- How to contain the width of the main component in Material UI Drawer component?
- converting react classes to functions with redux
- Handling optional function props - defaultProps or check prop exists?
- How to programatically navigate from an action creator using react-router v4?