crondate.js 433 B

12345678910111213141516
  1. // empty around comma
  2. var test = require('tap').test;
  3. var CronDate = require('../lib/date');
  4. test('is the last weekday of the month', function (t) {
  5. // Last monday of septhember
  6. var date = new CronDate(new Date(2021, 8, 27));
  7. t.equal(date.isLastWeekdayOfMonth(), true);
  8. // Second-to-last monday of septhember
  9. var date = new CronDate(new Date(2021, 8, 20));
  10. t.equal(date.isLastWeekdayOfMonth(), false);
  11. t.end();
  12. });