fix(test(mailer)): after move to zap
continuous-integration/drone the build was successful Details

This commit is contained in:
genofire 2021-09-29 14:47:31 +02:00
parent 980510a995
commit 023df961c2
1 changed files with 6 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.uber.org/zap"
"github.com/go-mail/mail" "github.com/go-mail/mail"
) )
@ -11,7 +12,9 @@ import (
func TestSetupAndPing(t *testing.T) { func TestSetupAndPing(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
mock, s := NewFakeServer() log := zap.L()
mock, s := NewFakeServer(log)
assert.NotNil(mock) assert.NotNil(mock)
// correct setup // correct setup
err := s.Setup() err := s.Setup()
@ -19,7 +22,7 @@ func TestSetupAndPing(t *testing.T) {
mock.Close() mock.Close()
s.SMTPPassword = "wrong" s.SMTPPassword = "wrong"
mock, s = newFakeServer(s) mock, s = newFakeServer(s, log)
// wrong password // wrong password
err = s.Setup() err = s.Setup()
assert.Error(err) assert.Error(err)
@ -29,7 +32,7 @@ func TestSetupAndPing(t *testing.T) {
func TestSend(t *testing.T) { func TestSend(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
mock, s := NewFakeServer() mock, s := NewFakeServer(zap.L())
assert.NotNil(mock) assert.NotNil(mock)
// correct setup // correct setup
err := s.Setup() err := s.Setup()