How to use the @wireapp/store-engine/dist/commonjs/engine.MemoryEngine function in @wireapp/store-engine

To help you get started, we’ve selected a few @wireapp/store-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireapp / wire-webapp / app / script / auth / util / TestUtil.tsx View on Github external
*
 */

import {APIClient} from '@wireapp/api-client';
import {MemoryEngine} from '@wireapp/store-engine/dist/commonjs/engine';
import {mount} from 'enzyme';
import * as React from 'react';
import {IntlProvider} from 'react-intl';
import {Provider} from 'react-redux';
import {HashRouter} from 'react-router-dom';
import {Store} from 'redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import {RootState} from '../module/reducer';

const engine = new MemoryEngine();
engine.init('test-execution');

const apiClient = new APIClient({
  store: engine,
  urls: APIClient.BACKEND.STAGING,
});

export const mockStore = (
  state = {
    authState: {},
    languageState: {
      language: 'en',
    },
  },
  extraArgument = {
    apiClient,