Open daminhtung opened 4 years ago
Pass an state to mockStore
, like this:
import configureStore from 'redux-mock-store';
import type { RootState } from '../../app/store';
const mockStore = configureStore<RootState>();
const store = mockStore({ slice: { ids: [], entities: {} } });
// Rest of the test...
Hi, I got an error when running the test. Any help or suggestions for me?
Error when run testing
TypeError: Cannot read property 'ids' of undefined
My test:
mySlice.ts