25 lines
432 B
Go
25 lines
432 B
Go
package twitterscraper_test
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestGetTrends(t *testing.T) {
|
|
if skipAuthTest {
|
|
t.Skip("Skipping test due to environment variable")
|
|
}
|
|
trends, err := testScraper.GetTrends()
|
|
if err != nil {
|
|
t.Fatal(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 empty")
|
|
}
|
|
}
|
|
}
|