Skip to content

Commit

Permalink
test(logger) : Add TestNosend
Browse files Browse the repository at this point in the history
  • Loading branch information
seipan committed Dec 12, 2023
1 parent d251df1 commit 5827d92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ package loghook
import (
"context"
"testing"

"github.com/stretchr/testify/assert"
)

var (
Expand Down Expand Up @@ -81,3 +83,11 @@ func TestSlackExampleWithContext(t *testing.T) {
logger.NoSendWarn()
logger.WarnContext(context.Background(), "test")
}

func TestSetNosend(t *testing.T) {
logger := NewLogger("", "test", "discord", DiscordWebhookURL)
logger.SetSendLevel(DebugLevel)
logger.setNosend()

assert.Equal(t, "nosend", logger.resWebhookURLbyLevel(DebugLevel))
}

0 comments on commit 5827d92

Please sign in to comment.