Test cases are broken. Some of test cases are giving an undefined value to the DATE field of ADD EXERCISE. The undefined value causes an “Invalid Date” output to all DATE OUTPUTS. Making impossible to pass in the penultimate test
When I look at the response from the limit=1 test I see two objects.
Request URL: https://boilerplate-project-exercisetracker.vitormagno.repl.co/api/users/c6e1c38283ff0a15c569647ee2ed0d6f/logs?limit=1
Response: {"_id":"c6e1c38283ff0a15c569647ee2ed0d6f","username":"fcc_test_16504838460","count":2,"log":[{"description":"test","duration":60,"date":"Mon Jan 01 1990"},{"description":"test","duration":60,"date":"Wed Jan 03 1990"}]}
Edit: Just to be clear. The date is optional.
You can POST to /api/users/:_id/exercises with form data description , duration , and optionally date . If no date is supplied, the current date will be used.
If one isn’t submitted you have to create it. So when req.body.date is undefined you can’t just pass undefined into the Date constructor.