Improve skip auth test

This commit is contained in:
Alexander Sheiko 2023-07-07 13:19:37 +03:00
parent 7393ab5136
commit 41b7e80ee8
3 changed files with 13 additions and 14 deletions

View file

@ -2,14 +2,13 @@ package twitterscraper_test
import (
"context"
"os"
"testing"
twitterscraper "github.com/n0madic/twitter-scraper"
)
func TestFetchSearchCursor(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
@ -30,7 +29,7 @@ func TestFetchSearchCursor(t *testing.T) {
}
func TestGetSearchProfiles(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
count := 0
@ -59,7 +58,7 @@ func TestGetSearchProfiles(t *testing.T) {
}
}
func TestGetSearchTweets(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
count := 0