2
0
mirror of https://github.com/status-im/go-waku.git synced 2025-01-27 05:56:07 +00:00
2022-07-23 08:12:56 -04:00

22 lines
389 B
Go

package logging
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
)
func Test_EmptyContext(t *testing.T) {
logger := From(context.Background())
require.Nil(t, logger)
}
func Test_With(t *testing.T) {
logger, err := zap.NewDevelopment()
require.NoError(t, err)
ctx := With(context.Background(), logger)
require.Equal(t, logger, From(ctx))
}