I have a calculateDateRange.js to get the list of the past 12 months from now. So how can test it using Jest?
export function getDateRange() {
const today = new Date();
this.months = [];
for (let i = -1; i >= 13; i--) {
const previousMonth = DateTime.add(today, "month", i);
previousMonth.setDate(1);
if (previousMonth.getFullYear() >= 2020) {
this.months.push(dateLong: previousMonth);
}
}
}