Skip to content

Commit dea284a

Browse files
committed
Fix multiple calls to done
1 parent 2315a40 commit dea284a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/lib.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,12 @@ describe('Test startJobTimer:', function () {
316316
});
317317

318318
it('expect process killed', function (done) {
319+
let nCalls = 0; // Make sure we only call done once, after first timeout
319320
const childProcess = {
320-
kill: () => { done(); },
321+
kill: () => {
322+
nCalls++;
323+
if (nCalls === 1) done();
324+
},
321325
pid: 10108
322326
};
323327
const job = queue.add({});

0 commit comments

Comments
 (0)