From fe30d9d533c5cc151a598df5daa71d226022c071 Mon Sep 17 00:00:00 2001 From: Yuriy Date: Wed, 28 Jul 2021 11:07:37 +0300 Subject: [PATCH] test: added failing schedule().next() test #14 --- test/core/schedule-test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/core/schedule-test.js b/test/core/schedule-test.js index 25b3424..fd03b1e 100644 --- a/test/core/schedule-test.js +++ b/test/core/schedule-test.js @@ -66,6 +66,12 @@ describe('Schedule', function () { const s = { schedules: [{ Y: [2017] }] }; should.equal(schedule(s).next(1, d, e), later.NEVER); }); + + it('should return next schedule if previous schedule has next date later.NEVER', function () { + const d = new Date('2013-03-21T00:00:05Z'); + const s = { schedules: [{ Y: [2012] }, { Y: [2017] }] }; + schedule(s).next(1, d).should.eql(new Date('2017-01-01T00:00:00Z')); + }); }); describe('prev', function () {