Hi everyone,
I have been stuck on exercise tracker for few days.
Its failing test 5 and 6.
I’ve had a look in date formatting, and setting duration as number.
Its not helping. Are there any other test cases out there?
solution: https://boilerplate-project-exercisetracker.supersyd.repl.co
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
.
Challenge: Exercise Tracker
Link to the challenge:
UPDATE: Test 4 was not supposed to be passing!
1: Only create new date in test 4 when undefined or empty, not in test 5 and 6
2: For test 5 and 6, if “to” and “from” query is empty or undefined, do not include them in response
return res.json({
_id: mongoose.Types.ObjectId(data._id),
username: data.username,
count: myArray.length,
log: myArray
})
3: If “to” or “from” is not empty or not undefined in query, include one of them or both if they are both not empty or not undefined
return res.json({
_id: mongoose.Types.ObjectId(data._id),
username: data.username,
from: myFromDate,
count: myArray.length,
log: myArray
})
return res.json({
_id: mongoose.Types.ObjectId(data._id),
username: data.username,
to: myToDate,
count: myArray.length,
log: myArray
})
return res.json({
_id: mongoose.Types.ObjectId(data._id),
username: data.username,
from: myFromDate,
to: myToDate,
count: myArray.length,
log: myArray
})
4: In the testing site, open inspect element in browser settings or press F12 then go to network, and click preview tab
There was an error in test 4 in the add exercise part and it passed in error.