All files / spec/helpers create_mock_store.js

100% Statements 4/4
100% Branches 0/0
50% Functions 1/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171x       4x           4x       4x    
import { applyMiddleware } from 'redux'
 
export default (middlewares, mockDispatch) => {
  function mockStoreWithoutMiddleware() {
    return {
      getState() {},
      dispatch: mockDispatch,
    }
  }
 
  const mockStoreWithMiddleware = applyMiddleware(
    ...middlewares
  )(mockStoreWithoutMiddleware)
 
  return mockStoreWithMiddleware()
}