TestScanNoHeartbeatWithoutSubscribedRoots pins that the heartbeat only fires when there is at least one subscribed repo. Before any subscribe call, Scan() must still short-circuit to nil so the WebSocket handler does not spam empty messages to a client that has not registered any paths yet.
(t *testing.T)
| 313 | // WebSocket handler does not spam empty messages to a client that |
| 314 | // has not registered any paths yet. |
| 315 | func TestScanNoHeartbeatWithoutSubscribedRoots(t *testing.T) { |
| 316 | t.Parallel() |
| 317 | |
| 318 | logger := slogtest.Make(t, nil) |
| 319 | h := agentgit.NewHandler(logger) |
| 320 | |
| 321 | msg := h.Scan(context.Background()) |
| 322 | require.Nil(t, msg, "no subscribed roots should mean no heartbeat") |
| 323 | } |
| 324 | |
| 325 | func TestScanDeltaDetectsContentChanges(t *testing.T) { |
| 326 | t.Parallel() |
nothing calls this directly
no test coverage detected