diff --git a/test/workers/branch/schedule.spec.js b/test/workers/branch/schedule.spec.js index b113748534e3f35a8b7a5c66c06692c783bab783..9bd78798ad5edb309f1c1511cb2d46664a8805af 100644 --- a/test/workers/branch/schedule.spec.js +++ b/test/workers/branch/schedule.spec.js @@ -78,7 +78,7 @@ describe('workers/branch/schedule', () => { describe('isScheduledNow(config)', () => { let config; beforeEach(() => { - mockDate.set(1498812608678); // 2017-06-30 10:50am + mockDate.set('2017-06-30T10:50:00.000'); // Locally 2017-06-30 10:50am jest.resetAllMocks(); config = {}; }); @@ -114,6 +114,7 @@ describe('workers/branch/schedule', () => { it('supports timezone', () => { config.schedule = ['after 4:00pm']; config.timezone = 'Asia/Singapore'; + mockDate.set('2017-06-30T10:50:00.000Z'); // Globally 2017-06-30 10:50am const res = schedule.isScheduledNow(config); expect(res).toBe(true); }); @@ -159,7 +160,7 @@ describe('workers/branch/schedule', () => { }); it('approves first day of the month', () => { config.schedule = ['before 11am on the first day of the month']; - mockDate.set(1506835566000); // Sunday, 1 October 2017 05:26:06 + mockDate.set('2017-10-01T05:26:06.000'); // Locally Sunday, 1 October 2017 05:26:06 const res = schedule.isScheduledNow(config); expect(res).toBe(true); });