test try-errors checks on FeedCiount counting

This commit is contained in:
albert
2025-07-29 01:03:51 +02:00
parent 26e8b83c87
commit b936697659

View File

@ -47,5 +47,13 @@ describe('ScrapingService', () => {
expect(mockFeedRepository.count).toHaveBeenCalled();
expect(count).toBe(5);
});
test('should handle repository errors when getting feed count', async () => {
const errorMessage = 'Database connection failed';
mockFeedRepository.count.mockRejectedValue(new Error(errorMessage));
await expect(scrapingService.getFeedCount()).rejects.toThrow(errorMessage);
expect(mockFeedRepository.count).toHaveBeenCalled();
});
});
});