diff --git a/cmd/main_test.go b/cmd/main_test.go index 0b6dd09..9f77255 100644 --- a/cmd/main_test.go +++ b/cmd/main_test.go @@ -7,7 +7,12 @@ import ( func TestExecute(t *testing.T) { // This test simply checks that the Execute function can be called without error. // It doesn't actually test any of the application's functionality. + rootCmd.SetArgs([]string{}) + t.Cleanup(func() { + rootCmd.SetArgs(nil) + }) if err := Execute(); err != nil { t.Errorf("Execute() failed: %v", err) } } +}