(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestTrackCommandCompleted_SkipsWhenPreRunNeverRan(t *testing.T) { |
| 50 | client := &recordingTelemetryClient{} |
| 51 | // An empty command path means PersistentPreRunE never ran. |
| 52 | ctx := newTelemetryContext(client, "") |
| 53 | |
| 54 | trackCommandCompleted(ctx, &cobra.Command{Use: "algolia"}, exitOK, nil, time.Second) |
| 55 | |
| 56 | if len(client.events) != 0 { |
| 57 | t.Errorf("expected no event, got %d", len(client.events)) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func TestTrackCommandCompleted_ReportsSuccess(t *testing.T) { |
| 62 | client := &recordingTelemetryClient{} |
nothing calls this directly
no test coverage detected