Assert that the connection closes, optionally with an expected code
OptionalexpectedCode: numberAssert that the next message equals the expected value
Close the WebSocket connection
Optionalcode: numberOptionalreason: stringSend a message through the WebSocket
Wait for the connection to close
Wait for the next message, returning its data
TestWsConnection
Live WebSocket connection wrapper with assertion helpers for testing.
Example