Skip to content

Commit

Permalink
fixing Test file
Browse files Browse the repository at this point in the history
Signed-off-by: manisha kumari <manisha.kumari@calsoftinc.com>
  • Loading branch information
ManishaKumari295 committed May 30, 2024
1 parent 2163ad4 commit f745cfd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ func TestCheckArgs(t *testing.T) {
// Test case where webhook URL is missing
event := &corev2.Event{}
err := checkArgs(event)
//assert.NotNil(t, err)
assert.Error(t, fmt.Errorf("--%s or SLACK_WEBHOOK_URL environment variable is required", webHookURL), err.Error())
fmt.Println("ERR is", err)
assert.NotNil(t, err)
assert.Equal(t, fmt.Sprintf("--%s or SLACK_WEBHOOK_URL environment variable is required", webHookURL), err.Error())

// Test case where webhook URL is provided
config.slackwebHookURL = "http://example.com/webhook"
err = checkArgs(event)
assert.Nil(t, err)
//config.slackwebHookURL = "http://example.com/webhook"
//err = checkArgs(event)
//assert.Nil(t, err)
}

0 comments on commit f745cfd

Please sign in to comment.