Files
Erupe/server/api/test_helpers.go
Houmgaor f17cb96b52 refactor(config): rename package _config to config with cfg alias
The config package used `package _config` with a leading underscore,
which is unconventional in Go. Rename to `package config` (matching the
directory name) and use `cfg` as the standard import alias across all
93 importing files.
2026-02-21 13:20:15 +01:00

47 lines
1.0 KiB
Go

package api
import (
"testing"
cfg "erupe-ce/config"
"go.uber.org/zap"
)
// NewTestLogger creates a logger for testing
func NewTestLogger(t *testing.T) *zap.Logger {
logger, err := zap.NewDevelopment()
if err != nil {
t.Fatalf("Failed to create test logger: %v", err)
}
return logger
}
// NewTestConfig creates a default test configuration
func NewTestConfig() *cfg.Config {
return &cfg.Config{
API: cfg.API{
Port: 8000,
PatchServer: "http://localhost:8080",
Banners: []cfg.APISignBanner{},
Messages: []cfg.APISignMessage{},
Links: []cfg.APISignLink{},
},
Screenshots: cfg.ScreenshotsOptions{
Enabled: true,
OutputDir: "/tmp/screenshots",
UploadQuality: 85,
},
DebugOptions: cfg.DebugOptions{
MaxLauncherHR: false,
},
GameplayOptions: cfg.GameplayOptions{
MezFesSoloTickets: 100,
MezFesGroupTickets: 50,
MezFesDuration: 604800, // 1 week
MezFesSwitchMinigame: false,
},
LoginNotices: []string{"Welcome to Erupe!"},
HideLoginNotice: false,
}
}