How would I unit test this utility that connects Redux to React components?
<p>I have a "utility" called "reduxify" that automatically does a lot of the Redux/React boilerplate for you, so that instead of writing "mapStateToProps" and "mapDispatchToProps" functions on every component, you just write your component like this:</p>

<pre><code>// usage. 

class Foo extends Component {
  // component stuff
}

export default reduxify(actions, Foo); 
</code></pre>

<p>The reduxify function (with comments) are at this gist: 
<a href="https://gist.github.com/brianboyko/904d87da2a75c98e8cd5f5352dd69d57" rel="nofollow">https://gist.github.com/brianboyko/904d87da2a75c98e8cd5f5352dd69d57</a></p>

<p>Without the comments (for brevity), it's produced below: </p>

<pre><code>import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { getStore } from '../store/storeConfig'

export function reduxify(actions, component){ 
  let mapStateToProps = (state) =&gt; {
    state = Object.assign({}, state, {store: state}, {getStore: getStore});
    return (state);
  }
  let prepareActions = (actions) =&gt; (dispatch) =&gt;
    ({ actions: bindActionCreators(actions.default, dispatch),
       dispatch: dispatch,
     })
  let mapDispatchToProps = (dispatch) =&gt; (prepareActions(actions, dispatch))
  return connect(mapStateToProps, mapDispatchToProps)(component);
}
</code></pre>

<p>So, here's the question: What's the best way to mock a component (one that will have access to the Provider) so that I can unit test this sucker, put it out there for people to use and enjoy, and not feel like a hack? </p>