Hierarchy (view full)

Constructors

  • Parameters

    • wsServer: Server<typeof WebSocket, typeof IncomingMessage>
    • headers: {
          [key: string]: string;
      } = {}
      • [key: string]: string
    • url: string = '/'

    Returns MockClient

Accessors

  • get didPeerCloseConnection(): boolean
  • Returns boolean

Methods

  • Parameters

    • code: number = 1005
    • Optionalreason: string | Buffer

    Returns void

  • Send ping to peer and return ping data.

    Parameters

    • Optionaldata: Buffer

    Returns Buffer

  • Connect to server, run callback and close the connection.

    Parameters

    • callback: (() => Promise<void>)

      The function to execute whilst connected to server

        • (): Promise<void>
        • Returns Promise<void>

    Returns Promise<void>