added test files

This commit is contained in:
KS Jannette
2026-05-19 03:49:03 -04:00
parent 749d544165
commit 700b7ad457
7 changed files with 292 additions and 11 deletions

27
pkg/logger/logger_test.go Normal file
View File

@@ -0,0 +1,27 @@
package logger
import (
"testing"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func TestInitializeZapGlobals_InfoLevel(t *testing.T) {
initializeZapGlobals("info")
if zap.L().Core().Enabled(zapcore.DebugLevel) {
t.Error("debug level should be disabled when LOG_LEVEL is info")
}
if !zap.L().Core().Enabled(zapcore.InfoLevel) {
t.Error("info level should be enabled")
}
}
func TestInitializeZapGlobals_DebugLevel(t *testing.T) {
initializeZapGlobals("debug")
if !zap.L().Core().Enabled(zapcore.DebugLevel) {
t.Error("debug level should be enabled")
}
}