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,7 +2,6 @@ package twitterscraper_test
import (
"context"
"os"
"testing"
"time"
@ -128,7 +127,7 @@ func TestGetTweetWithMultiplePhotos(t *testing.T) {
}
func TestGetTweetWithGIF(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
expectedTweet := twitterscraper.Tweet{
@ -155,7 +154,7 @@ func TestGetTweetWithGIF(t *testing.T) {
}
func TestGetTweetWithPhotoAndGIF(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
expectedTweet := twitterscraper.Tweet{
@ -299,7 +298,7 @@ func TestTweetViews(t *testing.T) {
}
func TestTweetThread(t *testing.T) {
if os.Getenv("SKIP_AUTH_TEST") != "" {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
tweet, err := testScraper.GetTweet("1665602315745673217")