lootsa tests fixes
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m19s

This commit is contained in:
2025-12-05 20:37:33 -08:00
parent 7added99b8
commit b456546feb
6 changed files with 43 additions and 64 deletions

View File

@@ -122,12 +122,13 @@ describe('Background Job Service', () => {
it('should schedule the cron job with the correct schedule and function', () => {
startBackgroundJobs();
expect(mockedCron.schedule).toHaveBeenCalledTimes(1);
// Check the schedule string
expect(mockedCron.schedule).toHaveBeenCalledWith('0 2 * * *', expect.any(Function));
// Check that the function passed is indeed runDailyDealCheck
expect(mockedCron.schedule.mock.calls[0][1]).toBe(runDailyDealCheck);
expect(mockedLogger.info).toHaveBeenCalledWith('[BackgroundJob] Cron job for daily deal checks has been scheduled.');
// Expect at least one job to be scheduled
expect(mockedCron.schedule).toHaveBeenCalled();
// Check specifically for the daily deal check job
expect(mockedCron.schedule).toHaveBeenCalledWith('0 2 * * *', runDailyDealCheck);
expect(mockedLogger.info).toHaveBeenCalledWith(expect.stringContaining('Cron job for daily deal checks has been scheduled'));
});
});
});