hnbot/sn_test.go

19 lines
349 B
Go
Raw Normal View History

2023-04-16 15:53:49 +00:00
package main
import (
2023-04-25 09:51:12 +00:00
"log"
2023-04-16 15:53:49 +00:00
"testing"
"github.com/stretchr/testify/assert"
)
func TestFetchDupes(t *testing.T) {
// TODO: mock HTTP request
url := "https://en.wikipedia.org/wiki/Dishwasher_salmon"
2023-04-25 09:51:12 +00:00
dupes, err := FetchStackerNewsDupes(url)
if err != nil {
log.Fatal(err)
}
2023-04-16 15:53:49 +00:00
assert.NotEmpty(t, *dupes, "Expected at least one duplicate")
}