saasitone/pkg/log/log_test.go

23 lines
383 B
Go
Raw Permalink Normal View History

package log
import (
"testing"
"github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
2024-07-09 17:57:05 -07:00
"git.grosinger.net/tgrosinger/saasitone/pkg/tests"
)
func TestCtxSet(t *testing.T) {
ctx, _ := tests.NewContext(echo.New(), "/")
logger := Ctx(ctx)
assert.NotNil(t, logger)
logger = logger.With("a", "b")
Set(ctx, logger)
got := Ctx(ctx)
assert.Equal(t, got, logger)
}