From 7370f0a953aafacc2925ed9754b1e0bf313a8305 Mon Sep 17 00:00:00 2001 From: "Chris S. Kim" Date: Fri, 9 Sep 2022 11:11:54 -0400 Subject: [PATCH] Fix test ordering (#14543) --- command/peering/list/list_test.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/command/peering/list/list_test.go b/command/peering/list/list_test.go index 06f9248b08..c015fc8e86 100644 --- a/command/peering/list/list_test.go +++ b/command/peering/list/list_test.go @@ -65,6 +65,21 @@ func TestListCommand(t *testing.T) { require.Contains(t, output, "no peering connections") }) + t.Run("no results - json", func(t *testing.T) { + ui := cli.NewMockUi() + cmd := New(ui) + + args := []string{ + "-http-addr=" + acceptor.HTTPAddr(), + "-format=json", + } + + code := cmd.Run(args) + require.Equal(t, 0, code) + output := ui.OutputWriter.String() + require.Contains(t, output, "[]") + }) + t.Run("two results for pretty print", func(t *testing.T) { generateReq := api.PeeringGenerateTokenRequest{PeerName: "foo"} @@ -94,21 +109,6 @@ func TestListCommand(t *testing.T) { require.Contains(t, lines[2], "foo") }) - t.Run("no results - json", func(t *testing.T) { - ui := cli.NewMockUi() - cmd := New(ui) - - args := []string{ - "-http-addr=" + acceptor.HTTPAddr(), - "-format=json", - } - - code := cmd.Run(args) - require.Equal(t, 0, code) - output := ui.OutputWriter.String() - require.Contains(t, output, "[]") - }) - t.Run("two results for JSON print", func(t *testing.T) { ui := cli.NewMockUi()