package main import ( "fmt" "io" "net/http/httptest" "os" "strings" "testing" "github.com/PuerkitoBio/goquery" "github.com/stretchr/testify/assert" ) type OpengraphFields struct { TwitterCard string TwitterTitle string Superscript string Subscript string Image string Video string VideoFullType string Text string TelegramAndroidApp string } func TestMain(m *testing.M) { initCache() code := m.Run() os.Exit(code) } func TestHomePage(t *testing.T) { r := httptest.NewRequest("GET", "/", nil) w := httptest.NewRecorder() renderEvent(w, r) if w.Code != 200 { t.Fatal("homepage is not 200") } if !strings.Contains(w.Body.String(), "