(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestWsHandlerJSON(t *testing.T) { |
| 37 | e := wsHandlerTester(t) |
| 38 | |
| 39 | ws := e.GET("/path").WithWebsocketUpgrade(). |
| 40 | Expect(). |
| 41 | Status(http.StatusSwitchingProtocols). |
| 42 | Websocket() |
| 43 | defer ws.Disconnect() |
| 44 | |
| 45 | ws.WriteJSON(struct { |
| 46 | Message string `json:"message"` |
| 47 | }{"hi"}). |
| 48 | Expect(). |
| 49 | TextMessage().JSON().Object().HasValue("message", "hi") |
| 50 | } |
| 51 | |
| 52 | func TestWsHandlerClose(t *testing.T) { |
| 53 | e := wsHandlerTester(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…