Skip to content

Commit

Permalink
test: update tests for UNIX day-of-week indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed May 21, 2023
1 parent b295cc1 commit f64a47a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/crontime.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ describe('crontime', () => {
}).toThrow();
});

it('should return the same object with 0 & 7 as Sunday (except "source" prop)', () => {
const sunday0 = new cron.CronTime('* * * * 0', null, null);
const sunday7 = new cron.CronTime('* * * * 7', null, null);
delete sunday0.source;
delete sunday7.source;
expect(sunday7).toEqual(sunday0);
});

describe('should test out of range values', () => {
it('should test out of range minute', () => {
expect(() => {
Expand Down Expand Up @@ -172,7 +180,7 @@ describe('crontime', () => {
new cron.CronTime('* * * * -1', null, null);
}).toThrow();
expect(() => {
new cron.CronTime('* * * * 7', null, null);
new cron.CronTime('* * * * 8', null, null);
}).toThrow();
});
});
Expand Down

0 comments on commit f64a47a

Please sign in to comment.