Exercise Tracker (BackEnd certification Project 4) not passing test case

Tell us what’s happening:
My output seems correct for this exercise tracker project, even the test case that is not passing, but it refuses to pass. The test case not passing is the following:

“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.”

However, when I test the application, all seems to work properly, and the output is displayed correctly. I was wondering if anyone can take a look at my code and see if they can help me uncover why this mysterious issue is occurring. Thank you. All help would be greatly appreciated.

Your project link(s)

solution: boilerplate-project-exercisetracker - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36

Challenge: Exercise Tracker

Link to the challenge:

Take a look at the time zone offset issue posts about this project and see if that’s your problem.

Ok will do. Thank you

I’ve taken a look at those posts. I appreciate the guidance, but I’m not sure how to remedy the issue. I’ve tested the project at multiple times of day but still get the same error, which I’m unsure of why because I believe the output for each date is correct.

That’s just the most common problem. Yours is different. I added some logging and get the following in several tests:

{ username: 'fcc_test_16477284234' }
req.body: [object Object]
matched exercise_object: {
  _id: '62365727ab7c573a30c61653',
  username: 'fcc_test_16477284234',
  description: '',
  duration: 0,
  date: ''
}
GET logs
req.body: {}
req.params: {"_id":"62365727ab7c573a30c61653"}
req.query: {}
log object: {"_id":"62365727ab7c573a30c61653","username":"fcc_test_16477284234","count":1,"log":[{"description":"test","duration":60,"date":"Invalid Date"}]}

So you’re not storing a date for every exercise record which means the returned records have no valid dates which fails the tests.

Ok thank you. I will try to look into it and see if i can resolve the issue.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.