Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created December 17, 2024 04:17
Show Gist options
  • Save YonatanKra/517dc5ae54f38822776b1958fb36943b to your computer and use it in GitHub Desktop.
Save YonatanKra/517dc5ae54f38822776b1958fb36943b to your computer and use it in GitHub Desktop.
describe('checkSinglePost()', () => {
it('should return the error message if fetch post failed', async () => {
resetAtpAgentMock();
const postUri = 'postUri';
const bot = new AltTextBot();
const error = { message: 'error' };
mockAtpAgent.getPost.mockRejectedValue(error);
const result = await bot.checkSinglePost(postUri);
expect(result).toEqual(error);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment