Skip to content

Commit 6446b64

Browse files
committed
fix(test): unlock job test fix
1 parent b8cc61f commit 6446b64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/job.test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ describe('Job', () => {
671671
});
672672

673673
it('clears locks on stop', async () => {
674-
agenda.define('longRunningJob', job => {
674+
agenda.define('longRunningJob', (_job, _cb) => {
675675
// eslint-disable-line no-unused-vars
676676
// Job never finishes
677677
});
@@ -680,14 +680,16 @@ describe('Job', () => {
680680

681681
await agenda.start();
682682
await delay(jobTimeout);
683+
const jobStarted = await agenda.db.getJobs({ name: 'longRunningJob' });
684+
expect(jobStarted[0].lockedAt).to.not.equal(null);
683685
await agenda.stop();
684686
const job = await agenda.db.getJobs({ name: 'longRunningJob' });
685-
expect(job[0].lockedAt).to.equal(null);
687+
expect(job[0].lockedAt).to.equal(undefined);
686688
});
687689

688690
describe('events', () => {
689691
beforeEach(() => {
690-
agenda.define('jobQueueTest', (job, cb) => {
692+
agenda.define('jobQueueTest', (_job, cb) => {
691693
cb();
692694
});
693695
agenda.define('failBoat', () => {

0 commit comments

Comments
 (0)