Skip to content

Commit

Permalink
Failing test for dates to make sure they fire only once.
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information
ncb000gt committed May 9, 2012
1 parent 1e2c7d0 commit 33d38fc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test-cron.js
Expand Up @@ -274,5 +274,19 @@ module.exports = testCase({
assert.done();
}, 2250);
}
},
'test dates fire only once': function(assert) {
assert.expect(1);
var count = 0;
var d = new Date().getTime() + 1000;
var job = cron.job(new Date(d), function() {
count++;
});
job.start();
setTimeout(function() {
job.stop();
assert.equal(count, 1);
assert.done();
}, 5250);
}
});

0 comments on commit 33d38fc

Please sign in to comment.