Fixed tests not working in timezones other than UTC

This commit is contained in:
Simon Backx 2022-07-13 12:26:02 +02:00
parent 51e3b0ac11
commit 9c90379892

View File

@ -41,10 +41,10 @@ describe('MembersStatsService', function () {
let db;
before(function () {
todayDate = moment(today).toDate();
tomorrowDate = moment(tomorrow).toDate();
yesterdayDate = moment(yesterday).toDate();
dayBeforeYesterdayDate = moment(dayBeforeYesterday).toDate();
todayDate = moment.utc(today).toDate();
tomorrowDate = moment.utc(tomorrow).toDate();
yesterdayDate = moment.utc(yesterday).toDate();
dayBeforeYesterdayDate = moment.utc(dayBeforeYesterday).toDate();
sinon.useFakeTimers(todayDate.getTime());
});