From b985ee12e53b5c2b747e2b6cc35dc23e1d668d69 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Mon, 2 Sep 2024 23:13:30 -0500 Subject: [PATCH] test(cmd): Fix failing test --- cmd/get/cmd_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/get/cmd_test.go b/cmd/get/cmd_test.go index 719faea3..9dc18e49 100644 --- a/cmd/get/cmd_test.go +++ b/cmd/get/cmd_test.go @@ -13,8 +13,8 @@ import ( func Test_preRun(t *testing.T) { type args struct { - cmd *cobra.Command - args []string + cmd *cobra.Command + _ []string } tests := []struct { name string @@ -29,9 +29,9 @@ func Test_preRun(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := tt.args.cmd.PersistentFlags().Set(server.APIFlagPrefix+server.AddressFlag, tt.want) require.NoError(t, err) - require.NoError(t, tt.args.cmd.ParseFlags(tt.args.args)) - err = preRun(tt.args.cmd, tt.args.args) + tt.args.cmd.RunE = func(_ *cobra.Command, _ []string) error { return nil } + err = tt.args.cmd.Execute() tt.wantErr(t, err) if err != nil { return