Closed tendolukwago closed 7 years ago
Could you create a repository that duplicates this error?
Created a repo you can find here.
For some reason, I'm not getting a "Cannot find module 'redux' in index.js" error when trying to run the test? I'm definitely missing something in this whole set up.
@tendolukwago I'm not seeing redux-mock-store
being included in the repository.
I'm not too familiar with React Native
, but Stack Overflow
might be a better place to answer a setup question like you're having.
@newyork-anthonyng Wow, dumb mistake. I updated the repo, if that helps. But sure, I'll see what SO has to offer.
@newyork-anthonyng Some time away from the test repo I created helped. Tests are now passing. I'll let you know if I manage to get everything working in my real project.
@newyork-anthonyng Found a file called "redux-mock-store.js" in my root mocks folder, containing the following:
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);
export default mockStore
Looks like I mocked the mock store a few weeks ago. Works like a charm now.
I have a set up that looks kind of like the following:
and keep getting "error: mockStore is not a function" when running my tests. Does anything stand out at you?