Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected createStore(
initialState: DeepPartial<s>,
middlewares: Middleware[]
) {
this.mergedPorts = configureTestPorts(
merge(this.defaultPorts, this.scenarioPorts) as ITestPortsParam
);
return configureStore(
merge(rootInitialState, initialState) as TStoreState,
this.mergedPorts as IPorts,
middlewares
);
}
</s>
constructor(
reduxState: DeepPartial = {},
ports: ITestPortsParam = {}
) {
this.tester = new ReduxSagaTester({
initialState: merge(initialState, reduxState),
reducers: rootReducer
});
this.ports = configureTestPorts(ports);
this.tester.start(rootSaga, (this.ports as unknown) as IPorts);
}
public toObject = (isServer = false) => {
this.dispatchedActions = [];
this.store = configureStore(
merge({}, rootInitialState, this.defaultReduxState, this.reduxState),
configureTestPorts({}),
[this.reduxHistoryMiddleware]
);
const err = this.error || this.defaultError;
const query = merge({}, this.defaultQuery, this.query);
const res = this.response || this.defaultResponse;
this.error = undefined;
this.query = {};
this.reduxState = {};
this.response = undefined;
return {
err,
isServer,
query,
protected createStore(
initialState: DeepPartial<s>,
middlewares: Middleware[]
) {
this.mergedPorts = configureTestPorts(
merge(this.defaultPorts, this.scenarioPorts) as ITestPortsParam
);
return configureStore(
merge(rootInitialState, initialState) as TStoreState,
this.mergedPorts as IPorts,
middlewares
);
}
</s>
public toObject = (isServer = false) => {
this.dispatchedActions = [];
this.store = configureStore(
merge({}, rootInitialState, this.defaultReduxState, this.reduxState),
configureTestPorts({}),
[this.reduxHistoryMiddleware]
);
const err = this.error || this.defaultError;
const query = merge({}, this.defaultQuery, this.query);
const res = this.response || this.defaultResponse;
this.error = undefined;
this.query = {};
this.reduxState = {};
this.response = undefined;
return {
err,
isServer,
query,
res,
store: this.store
} as any;
};