neet/masto.js

View on GitHub
tests/rest/v1/endorsements.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage
it("lists endorsements", async () => {
  await using alice = await sessions.acquire();
  await using bob = await sessions.acquire();

  try {
    await alice.rest.v1.accounts.$select(bob.id).follow();
    await alice.rest.v1.accounts.$select(bob.id).pin();
    const endorsements = await alice.rest.v1.endorsements.list();

    expect(endorsements).toContainId(bob.id);
  } finally {
    await alice.rest.v1.accounts.$select(bob.id).unfollow();
    await alice.rest.v1.accounts.$select(bob.id).unpin();
  }
});