Skip to content

Commit

Permalink
test: fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed May 22, 2024
1 parent 0489b8c commit d4715d9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/test_job.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
Expand All @@ -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);
})
Expand Down Expand Up @@ -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);
})
Expand Down Expand Up @@ -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);
})
Expand Down

0 comments on commit d4715d9

Please sign in to comment.