diff --git a/logger_test.go b/logger_test.go index 28478ae..18e588c 100644 --- a/logger_test.go +++ b/logger_test.go @@ -25,6 +25,8 @@ package loghook import ( "context" "testing" + + "github.com/stretchr/testify/assert" ) var ( @@ -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)) +}