lootsa tests fixes
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m19s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m19s
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user