Skip to content

Commit

Permalink
fix: adjust timing in unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed Jul 22, 2020
1 parent f32e77b commit fc6496b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/cron/__tests__/taskRunner.test.js
Expand Up @@ -35,20 +35,20 @@ describe('TaskRunner', () => {

test('it should run task', async () => {
TaskRunner.startTasks()
await delay(3000)
await delay(3500)
expect(executeSpy).toHaveBeenCalled()
})

test('it should run task again with rescheduled time', async () => {
await delay(3000)
await delay(3500)
TaskRunner.stopTasks()
expect(executeSpy).toHaveBeenCalledTimes(2)
})

test('it should run cron syntax multiple times', async () => {
TaskRunner.registerTask(testCronTask)
TaskRunner.startTasks()
await delay(2000)
await delay(2500)
TaskRunner.stopTasks()
expect(executeCronSpy).toHaveBeenCalledTimes(2)
})
Expand Down

0 comments on commit fc6496b

Please sign in to comment.