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

Function TestWsHandlerClose

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

Source from the content-addressed store, hash-verified

50}
51
52func TestWsHandlerClose(t *testing.T) {
53 e := wsHandlerTester(t)
54
55 ws := e.GET("/path").WithWebsocketUpgrade().
56 Expect().
57 Status(http.StatusSwitchingProtocols).
58 Websocket()
59 defer ws.Disconnect()
60
61 ws.CloseWithText("Namárië...", websocket.CloseGoingAway).
62 Expect().
63 CloseMessage().NoContent()
64}
65
66func wsFastHandlerTester(t *testing.T) *httpexpect.Expect {
67 return httpexpect.WithConfig(httpexpect.Config{

Callers

nothing calls this directly

Calls 10

wsHandlerTesterFunction · 0.85
WebsocketMethod · 0.80
StatusMethod · 0.80
WithWebsocketUpgradeMethod · 0.80
GETMethod · 0.80
DisconnectMethod · 0.80
CloseMessageMethod · 0.80
CloseWithTextMethod · 0.80
ExpectMethod · 0.45
NoContentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…