Skip to content

Commit

Permalink
test: add test for tsky.bsky.feed.getFeed()
Browse files Browse the repository at this point in the history
  • Loading branch information
shuuji3 committed Jan 8, 2025
1 parent 28f9a1e commit 54afc7a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/client/src/bsky/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,23 @@ describe('bsky', () => {
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // alice has some posts ;)
expect(paginator.values[0].feed[0]).toHaveProperty('post');
});

it('.feed()', async () => {
const tsky = await getAliceTsky();

const paginator = await tsky.bsky.feed.getFeed({
// "Birds! 🦉" custom feed
// - https://bsky.app/profile/daryllmarie.bsky.social/feed/aaagllxbcbsje
feed: 'at://did:plc:ffkgesg3jsv2j7aagkzrtcvt/app.bsky.feed.generator/aaagllxbcbsje',
limit: 30,
});

expect(paginator).toBeDefined();
expect(paginator.values).toBeDefined();
expect(paginator.values).toBeInstanceOf(Array);
expect(paginator.values.length).toBe(1); // we should get the first page from the paginator
expect(paginator.values[0].feed.length).toBeGreaterThan(0); // we found some birds posts ;)
expect(paginator.values[0].feed[0]).toHaveProperty('post');
});
});
});

0 comments on commit 54afc7a

Please sign in to comment.