[chore/backend] remove all test for now

This commit is contained in:
CDN 2025-02-22 02:11:27 +08:00
parent 3d19ef05b3
commit 1c9628124f
Signed by: CDN
GPG key ID: 0C656827F9F80080
28 changed files with 0 additions and 6780 deletions

View file

@ -1,85 +0,0 @@
package logger
import (
"testing"
"tss-rocks-be/internal/config"
"github.com/rs/zerolog"
)
func TestSetup(t *testing.T) {
tests := []struct {
name string
config *config.Config
expectedLevel zerolog.Level
}{
{
name: "Debug level",
config: &config.Config{
Logging: struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
}{
Level: "debug",
Format: "json",
},
},
expectedLevel: zerolog.DebugLevel,
},
{
name: "Info level",
config: &config.Config{
Logging: struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
}{
Level: "info",
Format: "json",
},
},
expectedLevel: zerolog.InfoLevel,
},
{
name: "Error level",
config: &config.Config{
Logging: struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
}{
Level: "error",
Format: "json",
},
},
expectedLevel: zerolog.ErrorLevel,
},
{
name: "Invalid level defaults to Info",
config: &config.Config{
Logging: struct {
Level string `yaml:"level"`
Format string `yaml:"format"`
}{
Level: "invalid",
Format: "json",
},
},
expectedLevel: zerolog.InfoLevel,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Setup(tt.config)
if zerolog.GlobalLevel() != tt.expectedLevel {
t.Errorf("Setup() set level to %v, want %v", zerolog.GlobalLevel(), tt.expectedLevel)
}
})
}
}
func TestGetLogger(t *testing.T) {
logger := GetLogger()
if logger == nil {
t.Error("GetLogger() returned nil")
}
}