fix test build

This commit is contained in:
Hugo Arregui 2023-08-08 10:49:20 -03:00
parent d73e4972e0
commit 3f07d147c9
No known key found for this signature in database
GPG Key ID: 5100706D2A1AFAD4

View File

@ -1,24 +1,22 @@
import { createFetchComponent } from '@well-known-components/fetch-component'
import { createContentClient } from 'dcl-catalyst-client'
import createSagasMiddleware from 'redux-saga'
import { createStorageMiddleware } from 'decentraland-dapps/dist/modules/storage/middleware'
import { MarketplaceGraphClient } from '../lib/MarketplaceGraphClient'
import { createRootReducer } from '../modules/reducer'
import { rootSaga } from '../modules/saga'
import createSagasMiddleware from "redux-saga";
import { createStorageMiddleware } from "decentraland-dapps/dist/modules/storage/middleware";
import { createRootReducer } from "../modules/reducer";
import { rootSaga } from "../modules/saga";
export function initTestStore(preloadedState = {}) {
const sagasMiddleware = createSagasMiddleware()
const sagasMiddleware = createSagasMiddleware();
const { storageMiddleware, loadStorageMiddleware } = createStorageMiddleware({
storageKey: 'profile', // this is the key used to save the state in localStorage (required)
paths: [['identity', 'data']], // array of paths from state to be persisted (optional)
storageKey: "profile", // this is the key used to save the state in localStorage (required)
paths: [["identity", "data"]], // array of paths from state to be persisted (optional)
actions: [], // array of actions types that will trigger a SAVE (optional)
migrations: {} // migration object that will migrate your localstorage (optional)
})
const store = createRootReducer([sagasMiddleware, storageMiddleware], preloadedState)
const worldsContentClient = createContentClient({ url: 'WORLDS_CONTENT_SERVER_URL', fetcher: createFetchComponent() })
const marketplaceGraphClient = new MarketplaceGraphClient('MARKETPLACE_GRAPH_URL')
sagasMiddleware.run(rootSaga, worldsContentClient, marketplaceGraphClient)
loadStorageMiddleware(store)
migrations: {}, // migration object that will migrate your localstorage (optional)
});
const store = createRootReducer(
[sagasMiddleware, storageMiddleware],
preloadedState
);
sagasMiddleware.run(rootSaga);
loadStorageMiddleware(store);
return store
return store;
}