Skip to content

Commit fd5a5e6

Browse files
author
Louis Béranger
committed
fix: Remove source prop from tests
1 parent f879357 commit fd5a5e6

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

test/tweet.v2.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,12 @@ describe('Tweets endpoints for v2 API', () => {
112112

113113
it('.tweets - Fetch a bunch of tweets', async () => {
114114
const tweets = await client.v2.tweets(['20', '1257577057862610951'], {
115-
'tweet.fields': ['author_id', 'source'],
115+
'tweet.fields': ['author_id'],
116116
});
117117
expect(tweets.data).to.have.length(2);
118118

119119
const first = tweets.data[0];
120120
expect(first.author_id).to.be.a('string');
121-
expect(first.source).to.be.a('string');
122121
}).timeout(60 * 1000);
123122

124123
it('.like/.unlike - Like / unlike a single tweet', async () => {

test/user.v2.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('Users endpoints for v2 API', () => {
1717
it('.user/.users - Get users by ID', async () => {
1818
const jack = await roClient.v2.user('12', {
1919
'expansions': ['pinned_tweet_id'],
20-
'tweet.fields': ['source', 'lang'],
20+
'tweet.fields': ['lang'],
2121
'user.fields': 'username',
2222
});
2323

@@ -28,7 +28,6 @@ describe('Users endpoints for v2 API', () => {
2828
if (jack.data.pinned_tweet_id) {
2929
expect(jack.includes!).to.be.a('object');
3030
expect(jack.includes!.tweets).to.have.length.greaterThan(0);
31-
expect(jack.includes!.tweets![0]).to.haveOwnProperty('source');
3231
expect(jack.includes!.tweets![0]).to.haveOwnProperty('lang');
3332
}
3433

@@ -39,7 +38,7 @@ describe('Users endpoints for v2 API', () => {
3938
it('.userByUsername/.usersByUsernames - Get users by screen names', async () => {
4039
const jack = await roClient.v2.userByUsername('jack', {
4140
'expansions': ['pinned_tweet_id'],
42-
'tweet.fields': ['source', 'lang'],
41+
'tweet.fields': ['lang'],
4342
'user.fields': 'username',
4443
});
4544

@@ -50,7 +49,6 @@ describe('Users endpoints for v2 API', () => {
5049
if (jack.data.pinned_tweet_id) {
5150
expect(jack.includes!).to.be.a('object');
5251
expect(jack.includes!.tweets).to.have.length.greaterThan(0);
53-
expect(jack.includes!.tweets![0]).to.haveOwnProperty('source');
5452
expect(jack.includes!.tweets![0]).to.haveOwnProperty('lang');
5553
}
5654

@@ -61,7 +59,7 @@ describe('Users endpoints for v2 API', () => {
6159
it('.followers/.following - Get relationships of user', async () => {
6260
const followersOfJack = await roClient.v2.followers('12', {
6361
'expansions': ['pinned_tweet_id'],
64-
'tweet.fields': ['source', 'lang'],
62+
'tweet.fields': ['lang'],
6563
'user.fields': 'username',
6664
});
6765

@@ -70,13 +68,12 @@ describe('Users endpoints for v2 API', () => {
7068

7169
if (followersOfJack.includes?.tweets?.length) {
7270
expect(followersOfJack.includes.tweets).to.have.length.greaterThan(0);
73-
expect(followersOfJack.includes.tweets[0]).to.haveOwnProperty('source');
7471
expect(followersOfJack.includes.tweets[0]).to.haveOwnProperty('lang');
7572
}
7673

7774
const followingsOfJack = await roClient.v2.following('12', {
7875
'expansions': ['pinned_tweet_id'],
79-
'tweet.fields': ['source', 'lang'],
76+
'tweet.fields': ['lang'],
8077
'user.fields': 'username',
8178
});
8279

@@ -85,7 +82,6 @@ describe('Users endpoints for v2 API', () => {
8582

8683
if (followingsOfJack.includes?.tweets?.length) {
8784
expect(followingsOfJack.includes.tweets).to.have.length.greaterThan(0);
88-
expect(followingsOfJack.includes.tweets[0]).to.haveOwnProperty('source');
8985
expect(followingsOfJack.includes.tweets[0]).to.haveOwnProperty('lang');
9086
}
9187
}).timeout(60 * 1000);
@@ -144,11 +140,10 @@ describe('Users endpoints for v2 API', () => {
144140
it('.userLikedTweets - Last tweets liked by a user', async () => {
145141
const { readOnly } = userClient;
146142

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'] });
148144
expect(jackLikedTweets.tweets).to.have.length.greaterThan(0);
149145

150146
expect(jackLikedTweets.tweets[0].created_at).to.be.a('string');
151-
expect(jackLikedTweets.tweets[0].source).to.be.a('string');
152147
expect(jackLikedTweets.meta.next_token).to.be.a('string');
153148
}).timeout(60 * 1000);
154149
});

0 commit comments

Comments
 (0)