diff --git a/tests/test_job_scheduler.ts b/tests/test_job_scheduler.ts index 2066679fe0..01350c7ed1 100644 --- a/tests/test_job_scheduler.ts +++ b/tests/test_job_scheduler.ts @@ -1222,13 +1222,11 @@ describe('Job Scheduler', function () { this.clock.tick(nextMonth - now); }; - const worker = new Worker( - queueName, - async () => { - nextTick(); - }, - { autorun: false, connection, prefix }, - ); + const worker = new Worker(queueName, async () => {}, { + autorun: false, + connection, + prefix, + }); const delayStub = sinon.stub(worker, 'delay').callsFake(async () => {}); let counter = 25; @@ -1236,6 +1234,7 @@ describe('Job Scheduler', function () { const completing = new Promise((resolve, reject) => { worker.on('completed', async job => { try { + nextTick(); if (prev) { expect(prev.timestamp).to.be.lt(job.timestamp); const diff = moment(job.processedOn!).diff(