package test import ( "context" "os" "testing" "tinyskin/config" "tinyskin/server" "github.com/pelletier/go-toml/v2" "github.com/samber/lo" ) func TestMain(m *testing.M) { ctx := context.Background() b := lo.Must(os.ReadFile("config.toml")) var config config.Config lo.Must0(toml.Unmarshal(b, &config)) s, cancel := lo.Must2(server.InitializeRoute(ctx, config)) defer cancel() go func() { s.ListenAndServe() }() os.Exit(m.Run()) }