UNPKG

jest-websocket-mock

Version:

Mock websockets and assert complex websocket interactions with Jest

14 lines (13 loc) 457 B
import { DeserializedMessage } from "./websocket"; declare type ReceiveMessageOptions = { timeout?: number; }; declare global { namespace jest { interface Matchers<R, T> { toReceiveMessage<TMessage = object>(message: DeserializedMessage<TMessage>, options?: ReceiveMessageOptions): Promise<R>; toHaveReceivedMessages<TMessage = object>(messages: Array<DeserializedMessage<TMessage>>): R; } } } export {};