join functions

This commit is contained in:
Kirill Zhuravlev 2023-02-15 02:33:11 +01:00 committed by Avelino
parent 8353845a8c
commit 8ec7df333c
No known key found for this signature in database
GPG Key ID: B345B4D52E98180A

View File

@ -31,22 +31,16 @@ func requireNoErr(t *testing.T, err error, msg string) {
}
}
func getReadmeHTML(t *testing.T) []byte {
func goqueryFromReadme(t *testing.T) *goquery.Document {
t.Helper()
input, err := os.ReadFile(readmePath + "asdasd")
input, err := os.ReadFile(readmePath)
requireNoErr(t, err, "readme file should be exists")
html, err := markdown.ToHTML(input)
requireNoErr(t, err, "markdown should be rendered to html")
return html
}
func goqueryFromReadme(t *testing.T) *goquery.Document {
t.Helper()
buf := bytes.NewBuffer(getReadmeHTML(t))
buf := bytes.NewBuffer(html)
doc, err := goquery.NewDocumentFromReader(buf)
requireNoErr(t, err, "html must be valid for goquery")