@signalwire/js
Version:
77 lines • 2.93 kB
TypeScript
import { EventEmitter } from '@signalwire/core';
/**
* Helper method to configure a Store w/o Saga middleware.
* Useful to test slices and reducers logic.
*
* @returns Redux Store
*/
export declare const configureJestStore: () => {
runSaga: <T>(saga: import("@redux-saga/types").Saga, args: {
instance: T;
runSaga: any;
}) => import("@redux-saga/types").Task<any>;
channels: import("@signalwire/core").InternalChannels;
instanceMap: import("@signalwire/core").InstanceMap;
sessionEmitter: EventEmitter<import("@signalwire/core").ClientEvents, any>;
dispatch: import("redux").Dispatch<import("redux").AnyAction>;
getState(): any;
subscribe(listener: () => void): import("redux").Unsubscribe;
replaceReducer(nextReducer: import("redux").Reducer<any, import("redux").AnyAction>): void;
[Symbol.observable](): import("redux").Observable<any>;
};
/**
* Helper method to configure a Store with a rootSaga
* and a mocked Session object.
* This allow to write integration tests.
*
* @returns { store, session, emitter, destroy }
*/
export declare const configureFullStack: () => {
store: {
runSaga: <T>(saga: import("@redux-saga/types").Saga, args: {
instance: T;
runSaga: any;
}) => import("@redux-saga/types").Task<any>;
channels: import("@signalwire/core").InternalChannels;
instanceMap: import("@signalwire/core").InstanceMap;
sessionEmitter: EventEmitter<import("@signalwire/core").ClientEvents, any>;
dispatch: import("redux").Dispatch<import("redux").AnyAction>;
getState(): any;
subscribe(listener: () => void): import("redux").Unsubscribe;
replaceReducer(nextReducer: import("redux").Reducer<any, import("redux").AnyAction>): void;
[Symbol.observable](): import("redux").Observable<any>;
};
session: {
dispatch: {
(...data: any[]): void;
(message?: any, ...optionalParams: any[]): void;
};
connect: jest.Mock<any, any, any>;
disconnect: jest.Mock<any, any, any>;
execute: jest.Mock<any, any, any>;
};
emitter: EventEmitter<string | symbol, any>;
destroy: () => {
payload: undefined;
type: "swSdk/destroy";
};
};
export declare const dispatchMockedRoomSubscribed: ({ session, roomId, roomSessionId, memberId, callId, }: {
session: any;
roomSessionId: string;
roomId: string;
memberId: string;
callId: string;
}) => void;
export declare const dispatchMockedCallJoined: ({ session, roomId, roomSessionId, memberId, memberId2, callId, nodeId, originCallId, capabilities, }: {
session: any;
roomSessionId: string;
roomId: string;
memberId: string;
memberId2?: string;
callId: string;
nodeId: string;
originCallId: string;
capabilities: string[];
}) => void;
//# sourceMappingURL=testUtils.d.ts.map