MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestWsHandlerText

Function TestWsHandlerText

_examples/websocket_test.go:22–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestWsHandlerText(t *testing.T) {
23 e := wsHandlerTester(t)
24
25 ws := e.GET("/path").WithWebsocketUpgrade().
26 Expect().
27 Status(http.StatusSwitchingProtocols).
28 Websocket()
29 defer ws.Disconnect()
30
31 ws.WriteText("hi").
32 Expect().
33 TextMessage().Body().IsEqual("hi")
34}
35
36func TestWsHandlerJSON(t *testing.T) {
37 e := wsHandlerTester(t)

Callers

nothing calls this directly

Calls 11

wsHandlerTesterFunction · 0.85
WebsocketMethod · 0.80
StatusMethod · 0.80
WithWebsocketUpgradeMethod · 0.80
GETMethod · 0.80
DisconnectMethod · 0.80
TextMessageMethod · 0.80
WriteTextMethod · 0.80
ExpectMethod · 0.45
IsEqualMethod · 0.45
BodyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…