@@ -17,7 +17,7 @@ describe('Users endpoints for v2 API', () => {
17
17
it ( '.user/.users - Get users by ID' , async ( ) => {
18
18
const jack = await roClient . v2 . user ( '12' , {
19
19
'expansions' : [ 'pinned_tweet_id' ] ,
20
- 'tweet.fields' : [ 'source' , ' lang'] ,
20
+ 'tweet.fields' : [ 'lang' ] ,
21
21
'user.fields' : 'username' ,
22
22
} ) ;
23
23
@@ -28,7 +28,6 @@ describe('Users endpoints for v2 API', () => {
28
28
if ( jack . data . pinned_tweet_id ) {
29
29
expect ( jack . includes ! ) . to . be . a ( 'object' ) ;
30
30
expect ( jack . includes ! . tweets ) . to . have . length . greaterThan ( 0 ) ;
31
- expect ( jack . includes ! . tweets ! [ 0 ] ) . to . haveOwnProperty ( 'source' ) ;
32
31
expect ( jack . includes ! . tweets ! [ 0 ] ) . to . haveOwnProperty ( 'lang' ) ;
33
32
}
34
33
@@ -39,7 +38,7 @@ describe('Users endpoints for v2 API', () => {
39
38
it ( '.userByUsername/.usersByUsernames - Get users by screen names' , async ( ) => {
40
39
const jack = await roClient . v2 . userByUsername ( 'jack' , {
41
40
'expansions' : [ 'pinned_tweet_id' ] ,
42
- 'tweet.fields' : [ 'source' , ' lang'] ,
41
+ 'tweet.fields' : [ 'lang' ] ,
43
42
'user.fields' : 'username' ,
44
43
} ) ;
45
44
@@ -50,7 +49,6 @@ describe('Users endpoints for v2 API', () => {
50
49
if ( jack . data . pinned_tweet_id ) {
51
50
expect ( jack . includes ! ) . to . be . a ( 'object' ) ;
52
51
expect ( jack . includes ! . tweets ) . to . have . length . greaterThan ( 0 ) ;
53
- expect ( jack . includes ! . tweets ! [ 0 ] ) . to . haveOwnProperty ( 'source' ) ;
54
52
expect ( jack . includes ! . tweets ! [ 0 ] ) . to . haveOwnProperty ( 'lang' ) ;
55
53
}
56
54
@@ -61,7 +59,7 @@ describe('Users endpoints for v2 API', () => {
61
59
it ( '.followers/.following - Get relationships of user' , async ( ) => {
62
60
const followersOfJack = await roClient . v2 . followers ( '12' , {
63
61
'expansions' : [ 'pinned_tweet_id' ] ,
64
- 'tweet.fields' : [ 'source' , ' lang'] ,
62
+ 'tweet.fields' : [ 'lang' ] ,
65
63
'user.fields' : 'username' ,
66
64
} ) ;
67
65
@@ -70,13 +68,12 @@ describe('Users endpoints for v2 API', () => {
70
68
71
69
if ( followersOfJack . includes ?. tweets ?. length ) {
72
70
expect ( followersOfJack . includes . tweets ) . to . have . length . greaterThan ( 0 ) ;
73
- expect ( followersOfJack . includes . tweets [ 0 ] ) . to . haveOwnProperty ( 'source' ) ;
74
71
expect ( followersOfJack . includes . tweets [ 0 ] ) . to . haveOwnProperty ( 'lang' ) ;
75
72
}
76
73
77
74
const followingsOfJack = await roClient . v2 . following ( '12' , {
78
75
'expansions' : [ 'pinned_tweet_id' ] ,
79
- 'tweet.fields' : [ 'source' , ' lang'] ,
76
+ 'tweet.fields' : [ 'lang' ] ,
80
77
'user.fields' : 'username' ,
81
78
} ) ;
82
79
@@ -85,7 +82,6 @@ describe('Users endpoints for v2 API', () => {
85
82
86
83
if ( followingsOfJack . includes ?. tweets ?. length ) {
87
84
expect ( followingsOfJack . includes . tweets ) . to . have . length . greaterThan ( 0 ) ;
88
- expect ( followingsOfJack . includes . tweets [ 0 ] ) . to . haveOwnProperty ( 'source' ) ;
89
85
expect ( followingsOfJack . includes . tweets [ 0 ] ) . to . haveOwnProperty ( 'lang' ) ;
90
86
}
91
87
} ) . timeout ( 60 * 1000 ) ;
@@ -144,11 +140,10 @@ describe('Users endpoints for v2 API', () => {
144
140
it ( '.userLikedTweets - Last tweets liked by a user' , async ( ) => {
145
141
const { readOnly } = userClient ;
146
142
147
- const jackLikedTweets = await readOnly . v2 . userLikedTweets ( '12' , { 'tweet.fields' : [ 'created_at' , 'source' ] } ) ;
143
+ const jackLikedTweets = await readOnly . v2 . userLikedTweets ( '12' , { 'tweet.fields' : [ 'created_at' ] } ) ;
148
144
expect ( jackLikedTweets . tweets ) . to . have . length . greaterThan ( 0 ) ;
149
145
150
146
expect ( jackLikedTweets . tweets [ 0 ] . created_at ) . to . be . a ( 'string' ) ;
151
- expect ( jackLikedTweets . tweets [ 0 ] . source ) . to . be . a ( 'string' ) ;
152
147
expect ( jackLikedTweets . meta . next_token ) . to . be . a ( 'string' ) ;
153
148
} ) . timeout ( 60 * 1000 ) ;
154
149
} ) ;
0 commit comments