From 9668106959a0036db26ce3a9f501c04676c502b9 Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Thu, 14 Nov 2024 10:30:04 -0800 Subject: [PATCH] Fix state unit tests Logging needs to be initialized in order for the state unit tests to function without issue. See previous commit ("Fix config unit tests") for more information. Signed-off-by: Ava Affine --- internal/state/state_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/state/state_test.go b/internal/state/state_test.go index 3d98b1c..e775e74 100644 --- a/internal/state/state_test.go +++ b/internal/state/state_test.go @@ -4,6 +4,8 @@ import ( "fmt" "testing" "time" + + "gitlab.com/whom/bingobot/internal/logging" ) /* WARNING: @@ -12,8 +14,15 @@ import ( */ const TestTok = "TEST_NAME" +var loggingInitialized = false func SetupTest(t *testing.T) { + // have to set up logger + if !loggingInitialized { + logging.Init() + loggingInitialized = true + } + old, _ := time.Parse( time.RFC3339, VeryOldVote,