(t *testing.T)
| 358 | } |
| 359 | |
| 360 | func TestTeamJSONErrorWritesNoSuccessOutput(t *testing.T) { |
| 361 | stubTeamClient(t, &mockTeamClient{ |
| 362 | getInfoFn: func() (*team.TeamGetInfoResult, error) { |
| 363 | return nil, errors.New("team failed") |
| 364 | }, |
| 365 | }) |
| 366 | |
| 367 | cmd, stdout := teamTestCmd(t, true) |
| 368 | if err := info(cmd, nil); err == nil { |
| 369 | t.Fatal("expected info error") |
| 370 | } |
| 371 | if got := stdout.String(); got != "" { |
| 372 | t.Fatalf("stdout = %q, want no success output", got) |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | func TestTeamCommandsSupportStructuredOutput(t *testing.T) { |
| 377 | for _, cmd := range []*cobra.Command{ |
nothing calls this directly
no test coverage detected