add followers method

This commit is contained in:
Valentine 2024-02-21 06:15:04 +03:00
parent 0046ed18c9
commit 5d3a5724f9
2 changed files with 87 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package twitterscraper_test
import (
"fmt"
"testing"
)
@ -9,6 +10,17 @@ func TestFetchFollowing(t *testing.T) {
if err != nil {
t.Error(err)
}
fmt.Println(users[0].Username)
if len(users) < 1 || users[len(users)-1].Username == "" {
t.Error("error FetchFollowing() No users found")
}
}
func TestFetchFollowers(t *testing.T) {
users, _, err := testScraper.FetchFollowers("Support", 20, "")
if err != nil {
t.Error(err)
}
if len(users) < 1 || users[len(users)-1].Username == "" {
t.Error("error FetchFollowing() No users found")
}