parent
97bef0257e
commit
c8a3d64918
14 changed files with 315 additions and 57 deletions
21
pkg/log/log_test.go
Normal file
21
pkg/log/log_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/mikestefanello/pagoda/pkg/tests"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue