File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ import { getGuestClient , logger } from '@test/init' ;
2+ import { printTweet } from '@test/util' ;
3+
4+ test ( 'getGuestTweetResultByRestId' , async ( ) => {
5+ logger . log ( 'getGuestTweetResultByRestId' ) ;
6+ const client = await getGuestClient ( ) ;
7+ const response = await client . getDefaultApi ( ) . getTweetResultByRestId ( { tweetId : '1349129669258448897' } ) ;
8+ printTweet ( response . data ! ) ;
9+ expect ( response . raw . response . ok ) . toBe ( true ) ;
10+ } ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ export const getClient = async () => {
3232 ct0 : CsrfToken ,
3333 auth_token : authToken ,
3434 } ) ;
35- // const client = await api.getClient();
35+ return client ;
36+ } ;
37+ export const getGuestClient = async ( ) => {
38+ const api = new TwitterOpenApi ( { fetchApi : fetch as any } ) ;
39+ const client = await api . getGuestClient ( ) ;
3640 return client ;
3741} ;
You can’t perform that action at this time.
0 commit comments