All checks were successful
check / check (push) Successful in 6s
Remove the Buildarch field from the globals package variable, struct, and constructor. Remove all references in main.go (including the runtime import), logger startup output, and test setup across globals, logger, database, and webhook_db_manager packages. closes #30
27 lines
473 B
Go
27 lines
473 B
Go
package globals
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"go.uber.org/fx/fxtest"
|
|
)
|
|
|
|
func TestNew(t *testing.T) {
|
|
// Set test values
|
|
Appname = "test-app"
|
|
Version = "1.0.0"
|
|
|
|
lc := fxtest.NewLifecycle(t)
|
|
globals, err := New(lc)
|
|
if err != nil {
|
|
t.Fatalf("New() error = %v", err)
|
|
}
|
|
|
|
if globals.Appname != "test-app" {
|
|
t.Errorf("Appname = %v, want %v", globals.Appname, "test-app")
|
|
}
|
|
if globals.Version != "1.0.0" {
|
|
t.Errorf("Version = %v, want %v", globals.Version, "1.0.0")
|
|
}
|
|
}
|