insomnia/packages/insomnia-app/app/__jest__/with-redux-store.tsx
2021-08-08 05:08:56 +00:00

14 lines
419 B
TypeScript

import React from 'react';
import { Provider } from 'react-redux';
import { MockStoreEnhanced } from 'redux-mock-store';
import { RootState } from '../ui/redux/modules';
export const withReduxStore = (store: MockStoreEnhanced<RootState, {}>) =>
class ReduxWrapper extends React.Component {
render() {
const { children } = this.props;
return <Provider store={store}>{children}</Provider>;
}
};