MCPcopy Create free account
hub / github.com/buggregator/server / TestSessionItemDiscarded

Function TestSessionItemDiscarded

modules/sentry/storage_test.go:457–476  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

455}
456
457func TestSessionItemDiscarded(t *testing.T) {
458 h := &handler{}
459
460 body := []byte(`{"event_id":"sess-env"}
461{"type":"session","length":0}
462{"sid":"test-session"}`)
463
464 inc, err := h.handleEnvelope(body, "proj")
465 if err != nil {
466 t.Fatal(err)
467 }
468
469 // Should still return a valid response (no error).
470 if inc == nil {
471 t.Fatal("expected non-nil incoming event")
472 }
473 if inc.Type != "sentry" {
474 t.Errorf("Type = %q, want 'sentry'", inc.Type)
475 }
476}
477
478func TestHandlerWithDB(t *testing.T) {
479 db := setupTestDB(t)

Callers

nothing calls this directly

Calls 1

handleEnvelopeMethod · 0.95

Tested by

no test coverage detected