Files
Gumble-Backend/internal/test/test_clock_test.go
Zane Walker 7e940c83a7
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
(Feat): Initial Commit
2026-07-03 19:41:31 +05:30

27 lines
543 B
Go

package test_test
import (
"testing"
"time"
"allaboutapps.dev/aw/go-starter/internal/api"
"allaboutapps.dev/aw/go-starter/internal/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestTestClock(t *testing.T) {
test.WithTestServer(t, func(s *api.Server) {
now := time.Date(2025, 2, 5, 11, 42, 30, 0, time.UTC)
test.SetMockClock(t, s, now)
assert.Equal(t, now, s.Clock.Now())
clock := test.GetMockClock(t, s.Clock)
require.NotNil(t, clock)
assert.Equal(t, now, clock.Now())
})
}