Skip to content

Commit

Permalink
update scheduledCronJobs unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowOfTheSpace committed Dec 20, 2024
1 parent 708e319 commit 7753be2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/unit/cron-jobs/scheduledCronJobs.spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const { checkUsersForLastLogin } = require('~/cron-jobs/checkForLastLogin')
const { removeUnverifiedUsers } = require('~/cron-jobs/removeUnverifiedUsers')
const { openScheduledCooperationResources } = require('~/cron-jobs/openScheduledCooperationResources')
const scheduledCronJobs = require('~/cron-jobs/scheduledCronJobs')

jest.mock('~/cron-jobs/checkForLastLogin', () => ({ checkUsersForLastLogin: { start: jest.fn() } }))
jest.mock('~/cron-jobs/removeUnverifiedUsers', () => ({ removeUnverifiedUsers: { start: jest.fn() } }))
jest.mock('~/cron-jobs/openScheduledCooperationResources', () => ({
openScheduledCooperationResources: { start: jest.fn() }
}))

describe('scheduledCronJobs', () => {
it('should call all the cron jobs', () => {
scheduledCronJobs()

expect(removeUnverifiedUsers.start).toHaveBeenCalled()
expect(checkUsersForLastLogin.start).toHaveBeenCalled()
expect(openScheduledCooperationResources.start).toHaveBeenCalled()
})
})

0 comments on commit 7753be2

Please sign in to comment.