'How to test a date is later/greater than another in jest?
I understand that JavaScript allows for basic comparison between dates e.g.,
const dateOne = new Date();
const dateTwo = new Date();
return dateTwo > dateOne;
I can see there is a .toBeGreaterThan() expectation in Jest, but this is only for numbers or big ints. Is there something available for dates to compare one is later than another?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
