@signalwire/core
Version:
Shared code for the SignalWire JS SDK
54 lines • 2.19 kB
TypeScript
import { ConfigureStoreOptions, SDKStore } from './redux';
import { SwEventChannel, SessionChannel } from './redux/interfaces';
import { RPCConnectResult, InternalSDKLogger } from './utils/interfaces';
import { EventEmitter } from './utils/EventEmitter';
export declare const createMockedLogger: () => InternalSDKLogger;
/**
* Helper method to configure a Store w/o Saga middleware.
* Useful to test slices and reducers logic.
*
* @returns Redux Store
*/
export declare const configureJestStore: (options?: Partial<ConfigureStoreOptions>) => SDKStore;
/**
* 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(".").InternalChannels;
instanceMap: import(".").InstanceMap;
sessionEmitter: EventEmitter<import(".").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 wait: (ms: number) => Promise<unknown>;
export declare const rpcConnectResultVRT: RPCConnectResult;
export declare const createSwEventChannel: () => SwEventChannel;
export declare const createSessionChannel: () => SessionChannel;
//# sourceMappingURL=testUtils.d.ts.map