A helper function for Jest unit tests that creates higher-order components
npm install @mt-testutils/mount-hocHelper function that:
* creates a mockStore with given state
* connects the component to the Redux store
* mounts a component with Enzyme
* allows to pass contextTypes, which will automatically added as props to the mounted component
npm install --save-dev @mt-testutils/mount-hoc
import mountHoc from '@mt-testutils/mount-hoc';
import myHoc from './myHoc';
// Props passed to the higher order component, defaults to {} if omitted
const props = {
someProp: 'some prop'
};
// Redux state, defaults to {} if omitted
const state = {
foo: 'bar'
};
// Component that is wrapped by the HOC, defaults to
* See CHANGELOG.md
* See CONTRIBUTING.md
Copyright © 2018 mobile.de GmbH