Exercise Tracker: error in test case 15. Expected dates contains same date twice

The expected dates array of the test case
The date property of any object in the log array that is returned from GET /api/users/:_id/logs should be a string. Use the dateString format of the Date API.
contains the same date twice.
At the time of execution it should have looked like
[
“Sat Jan 25 2025”,
“Sun Jan 26 2025”,
“Mon Jan 27 2025”
]
but the actual result was
[
“Sat Jan 25 2025”,
“Sun Jan 26 2025”,
“Sun Jan 26 2025”
]

Is your code not passing?

I tried with different timezones locally and no matter which one I picked, my code was passing.

But I would agree, looking at the code it seems the point is that the array should contain the previous, current, and next day. In which case, because the date was decrement, it would need to be increment by 2 and not 1 (or it should be set to the current date again in the middle array value).

If your code is not passing, I would suggest you open an issue for this on the tracker.


Tests:

PR that changed it:

My code wasn’t passing at first.

After I debugged the test case and found out about the date issues I changed my projects code to decrement the generated dates which then passed the tests.