Back End Development and APIs Projects - Exercise Tracker. Test 8 not passing

Tell us what’s happening:
Test 8 (“The response returned from POST /api/users/:_id/exercises will be the user object with the exercise fields added.”) is not passing even though my response object looks exactly how it should.

My response:

How it should look according to fCC:

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/ Safari/537.36

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

duration should be of type Number.

Ah thanks. Silly me, I hadn’t even noticed that. I was putting the input from the form directly in the response without parsing it, so it was a String. It seems Mongoose casts the String to a Number when saving the object, because that wasn’t erroring at all.

Have the same issue. Duration is number. Yet failing on test step #8

Solved! Turns out date format was different on “empty date field” vs “filed”.

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