diff --git a/internal/update/update.go b/internal/update/update.go index c323a102..7daeb3dd 100644 --- a/internal/update/update.go +++ b/internal/update/update.go @@ -223,7 +223,7 @@ func (u *UpdateNotification) isCI() bool { // isIgnoredCommand returns true when the process is in the list of commands. func (u *UpdateNotification) isIgnoredCommand() bool { - ignoredCommands := []string{"version"} + ignoredCommands := []string{"_fingerprint", "version"} osStr := os.Args[0:] if len(osStr) < 2 { return false diff --git a/internal/update/update_test.go b/internal/update/update_test.go index 90bf999c..dd9c44ad 100644 --- a/internal/update/update_test.go +++ b/internal/update/update_test.go @@ -16,6 +16,7 @@ package update import ( "context" + "os" "testing" "github.com/slackapi/slack-cli/internal/config" @@ -109,3 +110,39 @@ func Test_Update_HasUpdate(t *testing.T) { }) } } + +func Test_Update_isIgnoredCommand(t *testing.T) { + for name, tt := range map[string]struct { + command string + expected bool + }{ + "No command": { + command: "", + expected: false, + }, + "fingerprint command": { + command: "_fingerprint", + expected: true, + }, + "version command": { + command: "version", + expected: true, + }, + "auth command": { + command: "auth", + expected: false, + }, + } { + t.Run(name, func(t *testing.T) { + if tt.command != "" { + os.Args = []string{"placeholder", tt.command} + } else { + os.Args = []string{"placeholder"} + } + // Test + updateNotification := &UpdateNotification{} + actual := updateNotification.isIgnoredCommand() + require.Equal(t, tt.expected, actual) + }) + } +}