Skip to content

Commit 886f9a8

Browse files
committed
tests: fix context tests
1 parent 74aca0f commit 886f9a8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

internal/model/context_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func TestContext(t *testing.T) {
238238
_, err := c.NewFromGin(newGinCtx(nil, false))
239239
return err.Error()
240240
},
241-
expected: "failed to get user context",
241+
expected: model.ErrUserContextNotFound.Error(),
242242
},
243243
{
244244
description: "NewFromGin returns error when context value has wrong type",

internal/service/kubernetes_service_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ import (
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"
1010
"github.com/tinyauthapp/tinyauth/internal/model"
11+
"github.com/tinyauthapp/tinyauth/internal/utils/logger"
1112
)
1213

1314
func TestKubernetesService(t *testing.T) {
15+
log := logger.NewLogger().WithTestConfig()
16+
log.Init()
17+
1418
type testCase struct {
1519
description string
1620
run func(t *testing.T, svc *KubernetesService)
@@ -179,6 +183,7 @@ func TestKubernetesService(t *testing.T) {
179183
ingressApps: make(map[ingressKey][]ingressApp),
180184
domainIndex: make(map[string]ingressAppKey),
181185
appNameIndex: make(map[string]ingressAppKey),
186+
log: log,
182187
}
183188
test.run(t, svc)
184189
})

0 commit comments

Comments
 (0)