mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 19:51:20 +00:00
f5e5287082
Former-commit-id: 2ec35880b3aa30d3c217815c9a474e8d81ee1fa8 [formerly c20da02cf9149990f8b7913cfe426b8036992c16] Former-commit-id: 4851374829557f1523f5994b1d97e08e46979aed
25 lines
476 B
Go
25 lines
476 B
Go
package utils
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
logTest "github.com/sirupsen/logrus/hooks/test"
|
|
)
|
|
|
|
func TestHandleServiceErrors(t *testing.T) {
|
|
hook := logTest.NewGlobal()
|
|
done := make(chan struct{})
|
|
errChan := make(chan error)
|
|
|
|
go HandleServiceErrors(done, errChan)
|
|
|
|
errChan <- errors.New("something wrong")
|
|
done <- struct{}{}
|
|
msg := hook.LastEntry().Message
|
|
want := "something wrong"
|
|
if msg != want {
|
|
t.Errorf("incorrect log, expected %s, got %s", want, msg)
|
|
}
|
|
}
|