refactor: Implement test run helper to work with services

This commit is contained in:
Faruk AYDIN
2022-10-14 20:18:58 +02:00
parent 56a9aeece7
commit 628f872180
11 changed files with 262 additions and 119 deletions

View File

@@ -62,15 +62,13 @@ const searchTweets = async (
tweets.data.push(dataItem);
});
}
} while (response.data.meta.next_token && options.lastInternalId);
} while (response.data.meta.next_token && !$.execution.testRun);
tweets.data.sort((tweet, nextTweet) => {
return (tweet.raw.id as number) - (nextTweet.raw.id as number);
});
for (const tweet of tweets.data) {
await $.process(tweet);
}
return tweets;
};
export default searchTweets;