diff --git a/pkg/cmd/pr/update/update.go b/pkg/cmd/pr/update/update.go index 2d84a7ac1..323ca7bcc 100644 --- a/pkg/cmd/pr/update/update.go +++ b/pkg/cmd/pr/update/update.go @@ -111,7 +111,7 @@ func updateRun(opts *UpdateOptions) error { cs := opts.IO.ColorScheme() if comparison.BehindBy == 0 { // The PR branch is not behind the base branch, so it'a already up-to-date. - fmt.Fprintf(opts.IO.ErrOut, "%s PR branch already up-to-date\n", cs.SuccessIcon()) + fmt.Fprintf(opts.IO.Out, "%s PR branch already up-to-date\n", cs.SuccessIcon()) return nil } @@ -122,7 +122,7 @@ func updateRun(opts *UpdateOptions) error { return err } - fmt.Fprintf(opts.IO.ErrOut, "%s PR branch updated\n", cs.SuccessIcon()) + fmt.Fprintf(opts.IO.Out, "%s PR branch updated\n", cs.SuccessIcon()) return nil } diff --git a/pkg/cmd/pr/update/update_test.go b/pkg/cmd/pr/update/update_test.go index e55391aeb..e7bfd51e9 100644 --- a/pkg/cmd/pr/update/update_test.go +++ b/pkg/cmd/pr/update/update_test.go @@ -114,7 +114,6 @@ func Test_updateRun(t *testing.T) { input *UpdateOptions httpStubs func(*testing.T, *httpmock.Registry) stdout string - stderr string wantsErr string }{ { @@ -152,8 +151,7 @@ func Test_updateRun(t *testing.T) { assert.Equal(t, "head-repository-owner:head-ref-name", inputs["headRef"]) })) }, - stdout: "", - stderr: "✓ PR branch already up-to-date\n", + stdout: "✓ PR branch already up-to-date\n", }, { name: "success, already up-to-date, PR branch on the same repo as base", @@ -189,8 +187,7 @@ func Test_updateRun(t *testing.T) { assert.Equal(t, "head-ref-name", inputs["headRef"]) })) }, - stdout: "", - stderr: "✓ PR branch already up-to-date\n", + stdout: "✓ PR branch already up-to-date\n", }, { name: "success, merge", @@ -232,8 +229,7 @@ func Test_updateRun(t *testing.T) { assert.Equal(t, "MERGE", inputs["updateMethod"]) })) }, - stdout: "", - stderr: "✓ PR branch updated\n", + stdout: "✓ PR branch updated\n", }, { name: "success, rebase", @@ -276,8 +272,7 @@ func Test_updateRun(t *testing.T) { assert.Equal(t, "REBASE", inputs["updateMethod"]) })) }, - stdout: "", - stderr: "✓ PR branch updated\n", + stdout: "✓ PR branch updated\n", }, { name: "failure, API error on ref comparison request", @@ -347,7 +342,7 @@ func Test_updateRun(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ios, _, stdout, stderr := iostreams.Test() + ios, _, stdout, _ := iostreams.Test() ios.SetStdoutTTY(true) ios.SetStdinTTY(true) ios.SetStderrTTY(true) @@ -382,7 +377,6 @@ func Test_updateRun(t *testing.T) { } assert.Equal(t, tt.stdout, stdout.String()) - assert.Equal(t, tt.stderr, stderr.String()) }) } }