INNER CODE UNIT · Go
TestSetupStatic
kite-org/kite · main_test.go:120
func TestSetupStatic(t *testing.T) {
gin.SetMode(gin.TestMode)
oldBase := common.Base
oldEnableAnalytics := common.EnableAnalytics
defer func() {
common.Base = oldBase
common.EnableAnalytics = oldEnableAnalytics
}()
common.Base = "/kite"
common.EnableAnalytics = true
r := gin.New()
setupStatic(r)
t.Run("redirects root to base", func(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)