Permalink
Browse files

Failing test for dates to make sure they fire only once.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
ncb000gt committed May 9, 2012
1 parent 1e2c7d0 commit 33d38fc7ffda80f4b2f57b476d67041c7475aa15
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests/test-cron.js
View
@@ -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.