You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this module in a project tested with cypress.io and using the date mock method cy.clock() the function getDateAndTimeBeingFormatted throws this error: Unsupported relative time formatter input.
I believe this is because the check for a valid date is done using this expression.
In my case the constructor is not the Date object but rather one determined by lolex which Cypress uses under the hood. From my research on this subject, it seems appropriate to test the date in a manner similar to this popular SO post on the subject
The text was updated successfully, but these errors were encountered:
// During testing via some testing libraries `Date`s aren't actually `Date`s.// https://github.com/catamphetamine/javascript-time-ago/issues/22functionisMockedDate(object){returntypeofobject==='object'&&typeofobject.getTime==='function'}
When using this module in a project tested with cypress.io and using the date mock method
cy.clock()
the functiongetDateAndTimeBeingFormatted
throws this error:Unsupported relative time formatter input
.I believe this is because the check for a valid date is done using this expression.
In my case the constructor is not the Date object but rather one determined by lolex which Cypress uses under the hood. From my research on this subject, it seems appropriate to test the date in a manner similar to this popular SO post on the subject
The text was updated successfully, but these errors were encountered: