Skip to content

Commit

Permalink
more fun with expiration timeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
timgit committed Jun 13, 2017
1 parent 4777ca7 commit 50c8e0f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/expireTest.js
Expand Up @@ -50,12 +50,8 @@ describe('expire', function() {
const jobName = 'offExpire';
const jobRequest = {name: jobName, options: {expireIn:'1 second'}};

boss.on('expired-count', count => console.log(`${count} jobs expired.`));

let receivedCount = 0;

boss.subscribe(jobName, job => {});

boss.onExpire(jobName, job => {
receivedCount++;

Expand All @@ -69,10 +65,12 @@ describe('expire', function() {
setTimeout(() => {
assert.strictEqual(receivedCount, 1);
finished();
}, 3000);
}, 4000);

});

boss.subscribe(jobName, job => {});

});

it('should fetch an expired job', function(finished){
Expand Down

0 comments on commit 50c8e0f

Please sign in to comment.