diff --git a/test/manipulate.test.js b/test/manipulate.test.js index 6a85769ff..5af5bf366 100644 --- a/test/manipulate.test.js +++ b/test/manipulate.test.js @@ -52,3 +52,13 @@ it('Add Time days', () => { it('Subtract Time days', () => { expect(dayjs().subtract(1, 'days').valueOf()).toBe(moment().subtract(1, 'days').valueOf()) }) + +it('Add Time days (DST)', () => { + // change timezone before running test + // New Zealand (-720) + expect(dayjs('2018-04-01').add(1, 'd').format()).toBe(moment('2018-04-01').add(1, 'd').format()) + expect(dayjs('2018-03-28').add(1, 'w').format()).toBe(moment('2018-03-28').add(1, 'w').format()) + // London (-60) + expect(dayjs('2018-10-28').add(1, 'd').format()).toBe(moment('2018-10-28').add(1, 'd').format()) + expect(dayjs('2018-10-26').add(1, 'w').format()).toBe(moment('2018-10-26').add(1, 'w').format()) +})