(t *testing.T)
| 455 | } |
| 456 | |
| 457 | func 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 | |
| 478 | func TestHandlerWithDB(t *testing.T) { |
| 479 | db := setupTestDB(t) |
nothing calls this directly
no test coverage detected