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

Function testWebsocketHeader

e2e/websocket_test.go:96–106  ·  view source on GitHub ↗
(e *httpexpect.Expect)

Source from the content-addressed store, hash-verified

94}
95
96func testWebsocketHeader(e *httpexpect.Expect) {
97 resp := e.GET("/test").WithWebsocketUpgrade().
98 Expect().
99 Status(http.StatusSwitchingProtocols)
100
101 hdr := resp.Header("X-Test")
102 hdr.IsEqual("test_header")
103
104 ws := resp.Websocket()
105 ws.Disconnect()
106}
107
108func testWebsocketSession(e *httpexpect.Expect) {
109 ws := e.GET("/test").WithWebsocketUpgrade().

Callers 1

testWebsocketFunction · 0.85

Calls 8

StatusMethod · 0.80
WithWebsocketUpgradeMethod · 0.80
GETMethod · 0.80
HeaderMethod · 0.80
WebsocketMethod · 0.80
DisconnectMethod · 0.80
ExpectMethod · 0.45
IsEqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…