jeudi 12 mars 2020

Test UTC timezone in chai

I'm writing some tests and i'm wondering if there is some way to make time around midnight UTC time, then convert those to timestamped UTC dates, and make sure those still are the same in Italian dates even though they would be different in the UTC timezone ??

  it.only(`Should return false if the dates are not the same day but close to midnight`, () => {
            const dateA = this.convertDateToUnix(`2019-06-01 12:00:00`);
            const dateB = this.convertDateToUnix(`2019-05-01 23:59:00`);
            const response = this.compareDates(dateA, dateB);
            expect(response).to.equal(false);
        });

Aucun commentaire:

Enregistrer un commentaire