MCPcopy Index your code
hub / github.com/gotify/server / TestMessageDirectlyAfterConnect

Function TestMessageDirectlyAfterConnect

api/stream/stream_test.go:160–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

158}
159
160func TestMessageDirectlyAfterConnect(t *testing.T) {
161 mode.Set(mode.Prod)
162 defer leaktest.Check(t)()
163 server, api := bootTestServer(staticUserID())
164 defer server.Close()
165 defer api.Close()
166
167 wsURL := wsURL(server.URL)
168
169 user := testClient(t, wsURL)
170 defer user.conn.Close()
171
172 waitForConnectedClients(api, 1)
173
174 api.Notify(1, &model.MessageExternal{Message: "msg"})
175 user.expectMessage(&model.MessageExternal{Message: "msg"})
176}
177
178func TestDeleteClientShouldCloseConnection(t *testing.T) {
179 mode.Set(mode.Prod)

Callers

nothing calls this directly

Calls 9

SetFunction · 0.92
bootTestServerFunction · 0.85
staticUserIDFunction · 0.85
wsURLFunction · 0.85
testClientFunction · 0.85
waitForConnectedClientsFunction · 0.85
expectMessageMethod · 0.80
NotifyMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…