sendJSON sends a JSON payload over the websocket.
(t testing.TB, ws *websocket.Conn, v interface{})
| 92 | |
| 93 | // sendJSON sends a JSON payload over the websocket. |
| 94 | func sendJSON(t testing.TB, ws *websocket.Conn, v interface{}) { |
| 95 | t.Helper() |
| 96 | if err := websocket.JSON.Send(ws, v); err != nil { |
| 97 | t.Fatalf("websocket send: %v", err) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // recvJSON reads a JSON message with a timeout. |
| 102 | func recvJSON(t testing.TB, ws *websocket.Conn, timeout time.Duration) resource.WsOutMessage { |
no outgoing calls
no test coverage detected