@100mslive/hms-video-store
Version:
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
42 lines (41 loc) • 1.55 kB
TypeScript
/**
* Minimal HMSTransport instantiator for unit tests.
*
* Builds a real `HMSTransport` with the smallest mocks that get past the
* constructor and its initial subscriptions. Tests can then call
* private/arrow-field methods directly on the instance:
*
* const t = makeTransport();
* await (t as any).retrySignalDisconnectTask();
*
* For tests that exercise specific code paths, override fields after
* construction:
*
* (t as any).joinParameters = undefined;
* (t as any).signal = mySignalMock;
*
* This is deliberately not a "fake biz" or full integration harness —
* it's the smallest scaffolding that lets us exercise the real
* HMSTransport methods with controlled inputs.
*/
import { AnalyticsTimer } from '../../analytics/AnalyticsTimer';
import { DeviceManager } from '../../device-manager';
import { EventBus } from '../../events/EventBus';
import { Store } from '../../sdk/store';
import HMSTransport from '../../transport';
import ITransportObserver from '../../transport/ITransportObserver';
import { TransportState } from '../../transport/models/TransportState';
export declare const makeFakeObserver: () => ITransportObserver;
export interface MakeTransportOptions {
observer?: ITransportObserver;
store?: Partial<Store>;
}
export declare const makeTransport: (opts?: MakeTransportOptions) => {
transport: HMSTransport;
observer: ITransportObserver;
eventBus: EventBus;
store: Store;
analyticsTimer: AnalyticsTimer;
deviceManager: DeviceManager;
};
export { TransportState };