package main import ( "testing" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/httptest" ) func TestSitemap(t *testing.T) { const expectedFullSitemapXML = `http://localhost:8080/home2019-12-13T21:50:33+02:00hourly1http://localhost:8080/articlesdailyhttp://localhost:8080/path1http://localhost:8080/path2` app := newApp() app.Configure(iris.WithSitemap(startURL)) e := httptest.New(t, app) e.GET("/sitemap.xml").Expect().Status(httptest.StatusOK).Body().Equal(expectedFullSitemapXML) }