diff --git a/test/test_job.js b/test/test_job.js index 76cb729dc..882fba92f 100644 --- a/test/test_job.js +++ b/test/test_job.js @@ -608,12 +608,15 @@ describe('Job', () => { describe('.moveToCompleted', () => { it('marks the job as completed and returns new job', () => { return Job.create(queue, { foo: 'bar' }).then(job1 => { - return Job.create(queue, { foo: 'bar' }).then(job2 => { + return Job.create(queue, { foo: 'bar' }, { lifo: true }).then(job2 => { return job2 .isCompleted() .then(isCompleted => { expect(isCompleted).to.be(false); }) + .then(() => { + return scripts.moveToActive(queue); + }) .then(() => { return job2.moveToCompleted('succeeded', true); }) @@ -637,6 +640,9 @@ describe('Job', () => { .then(isFailed => { expect(isFailed).to.be(false); }) + .then(() => { + return scripts.moveToActive(queue); + }) .then(() => { return job.moveToFailed(new Error('test error'), true); }) @@ -702,6 +708,9 @@ describe('Job', () => { .then(isFailed => { expect(isFailed).to.be(false); }) + .then(() => { + return scripts.moveToActive(queue); + }) .then(() => { return job.moveToFailed(new Error('test error'), true); }) @@ -754,6 +763,9 @@ describe('Job', () => { .then(isFailed => { expect(isFailed).to.be(false); }) + .then(() => { + return scripts.moveToActive(queue); + }) .then(() => { return job.moveToFailed(new Error('test error'), true); })