Creates an instance of StubWebsocketConnection.
Optional supportsCache: booleanOptional authToken: stringUnique client id per server instance. This incremental value is resetted once the process is restarted.
Readonly clientInformation about the client connected to the WebSocket.
Protected connectionThe WebSocket connection object representing the connection to the client.
Describes the clients auth state
Private messagePrivate rejectsPrivate stackPrivate testingCan be used to store session credentials.
Static Private maxStatic routerRefers to a websocket router instance.
Gets the ID of the WebSocket connection.
Gets the testing identifier of the connection.
True if the connection has been closed
True if outbound caching is supported by the client.
This method is used to react to a specific message in a test case. The promises will be resolved in the order of the expected methods. All previously expected methods have to be received, before the method is expected.
A message with this method is expected.
Optional messageId: numberOptional timeout: numberTimeout value in milliseconds before test fails.
Optional hashCallback: ((specificHash, inserted, updated, deleted) => void)Promise, that is resolved once the provided method is received.
Calculates the modified rows of data, that have been changed since the last time data was cached.
The method of the associated Outbound.
The data returned from the outbound function.
Optional isPartial: booleanTrue when a part of the data is only present
the data changes (inserted, updated, deleted)
Outbound request config is used to store the length of entries, that have been previously requested by this client for partially sent outbounds.
The method of the outbound
the outbound request config
Protected onProtected onSends a WebSocket message.
The method of the message.
The value of the message.
Optional messageId: numberThe ID of the message.
Optional specificHash: numberThe specific hash value - used by outbounds with caching enabled.
Optional inserted: any[]Optional updated: any[]Optional deleted: any[]Optional length: numbertrue if the message is handled, false otherwise.
Outbound request config is used to store the length of entries, that have been previously requested by this client for partially sent outbounds.
The method of the outbound
The length of entries that have been requested.
Updates the cached outbound data for the associated outbound method.
The method of the associated Outbound.
The contents that have been added since the last time.
The contents that have been modified since the last time.
The contents that have been removed since the last time.
Protected withStatic addAdds a close handler to be called when the connection is closed.
The callback function to be called on connection close.
Static Protected getStatic Private loadGenerated using TypeDoc
Websocket Connection wrapper, can be used to create integration-tests for applications.