File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ func (u *UpdateNotification) isCI() bool {
223223
224224// isIgnoredCommand returns true when the process is in the list of commands.
225225func (u * UpdateNotification ) isIgnoredCommand () bool {
226- ignoredCommands := []string {"version" }
226+ ignoredCommands := []string {"_fingerprint" , " version" }
227227 osStr := os .Args [0 :]
228228 if len (osStr ) < 2 {
229229 return false
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ package update
1616
1717import (
1818 "context"
19+ "os"
1920 "testing"
2021
2122 "github.com/slackapi/slack-cli/internal/config"
@@ -109,3 +110,39 @@ func Test_Update_HasUpdate(t *testing.T) {
109110 })
110111 }
111112}
113+
114+ func Test_Update_isIgnoredCommand (t * testing.T ) {
115+ for name , tt := range map [string ]struct {
116+ command string
117+ expected bool
118+ }{
119+ "No command" : {
120+ command : "" ,
121+ expected : false ,
122+ },
123+ "fingerprint command" : {
124+ command : "_fingerprint" ,
125+ expected : true ,
126+ },
127+ "version command" : {
128+ command : "version" ,
129+ expected : true ,
130+ },
131+ "auth command" : {
132+ command : "auth" ,
133+ expected : false ,
134+ },
135+ } {
136+ t .Run (name , func (t * testing.T ) {
137+ if tt .command != "" {
138+ os .Args = []string {"placeholder" , tt .command }
139+ } else {
140+ os .Args = []string {"placeholder" }
141+ }
142+ // Test
143+ updateNotification := & UpdateNotification {}
144+ actual := updateNotification .isIgnoredCommand ()
145+ require .Equal (t , tt .expected , actual )
146+ })
147+ }
148+ }
You can’t perform that action at this time.
0 commit comments