Skip to content

Commit

Permalink
Add nextDates function test(called without argument)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidia committed Aug 14, 2020
1 parent 0f43fec commit 4d2932f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/cron.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,16 @@ describe('cron', () => {
clock.restore();
});

it('Should give an empty array', () => {
const callback = jest.fn();
const clock = sinon.useFakeTimers();
const job = new cron.CronJob('* * * * * *', callback);

expect(job.nextDates()).toHaveLength(0);

clock.restore();
});

it('should automatically setup a new timeout if we roll past the max timeout delay', () => {
const callback = jest.fn();
const clock = sinon.useFakeTimers();
Expand Down

0 comments on commit 4d2932f

Please sign in to comment.