twitter-scrapper/trends_test.go

23 lines
343 B
Go
Raw Normal View History

2020-02-12 10:45:19 +02:00
package twitterscraper
import (
"testing"
)
func TestGetTrends(t *testing.T) {
trends, err := GetTrends()
if err != nil {
t.Error(err)
}
if len(trends) != 20 {
t.Errorf("Expected 20 trends, got %d: %#v", len(trends), trends)
}
for _, trend := range trends {
if trend == "" {
t.Error("Expected trend is not empty")
}
2020-02-12 10:45:19 +02:00
}
}