package website import ( "net/http" "net/http/httptest" "testing" "github.com/schollz/progressbar/v3" ) func TestDownloadAndPackageWebsite(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case "/": w.Header().Set("Content-Type", "text/html") w.Write([]byte(`
`))
case "/style.css":
w.Header().Set("Content-Type", "text/css")
w.Write([]byte(`body { color: red; }`))
case "/image.png":
w.Header().Set("Content-Type", "image/png")
w.Write([]byte("fake image data"))
case "/page2.html":
w.Header().Set("Content-Type", "text/html")
w.Write([]byte(`