Skip to content

Commit

Permalink
Fix multiple calls to done
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Aug 12, 2022
1 parent 2315a40 commit dea284a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ describe('Test startJobTimer:', function () {
});

it('expect process killed', function (done) {
let nCalls = 0; // Make sure we only call done once, after first timeout
const childProcess = {
kill: () => { done(); },
kill: () => {
nCalls++;
if (nCalls === 1) done();
},
pid: 10108
};
const job = queue.add({});
Expand Down

0 comments on commit dea284a

Please sign in to comment.