adding first basic test ( ScrapginService)

This commit is contained in:
albert
2025-07-29 00:57:05 +02:00
parent 0d301f5c49
commit 29e7b9f8e0
2 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
import { ScrapingService } from '../services/ScrapingService';
import { IFeedRepository } from '../repositories/FeedRepository';
// Mock FeedRepository
const mockFeedRepository: jest.Mocked<IFeedRepository> = {
create: jest.fn(),
findAll: jest.fn(),
findById: jest.fn(),
findByUrl: jest.fn(),
findBySource: jest.fn(),
findTodaysFrontPage: jest.fn(),
update: jest.fn(),
delete: jest.fn(),
deleteMany: jest.fn(),
count: jest.fn(),
exists: jest.fn()
};
describe('ScrapingService', () => {
let scrapingService: ScrapingService;
beforeEach(() => {
jest.clearAllMocks();
scrapingService = new ScrapingService(mockFeedRepository);
});
describe('Basic Functionality', () => {
test('should create ScrapingService instance', () => {
expect(scrapingService).toBeInstanceOf(ScrapingService);
});
});
});