Skip to content

Commit

Permalink
Reset arguments in between command runs to avoid test pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
fhats-stripe committed Nov 4, 2024
1 parent 0234850 commit c66571a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func executeCommandC(root *cobra.Command, args ...string) (c *cobra.Command, out

c, err = root.ExecuteC()

// Resets args for the next test run to avoid arguments for flags being carried over
root.SetArgs([]string{})

return c, buf.String(), err
}

Expand Down

0 comments on commit c66571a

Please sign in to comment.