Tell us what’s happening:
ExerciseTracker Challenge
I kept failing the 10th-14th tests. Tests that dealt with the /api/users/:_userId/logs
route with GET HTTP request.
I don’t know why this is happens, the error says that it should return count property, log array and etc in the response. But I’ve tried it and its works fine to me. All of those properties are displayed in the responses.
Failed message received:
// running tests
1. A request to a user's log "GET /api/users/:_id/logs" returns a user object with a "count" property representing the number of exercises that belong to that user.
2. A "GET" request to "/api/users/:_id/logs" will return the user object with a "log" array of all the exercises added.
3. Each item in the "log" array that is returned from "GET /api/users/:_id/logs" is an object that should have a "description", "duration", and "date" properties.
4. The "description" property of any object in the "log" array that is returned from "GET /api/users/:_id/logs" should be a string.
5. The "duration" property of any object in the "log" array that is returned from "GET /api/users/:_id/logs" should be a number.
6. 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.
7. (Optional) You can add "from", "to" and "limit" parameters to a "GET /api/users/:_id/logs" request to retrieve part of the log of any user. "from" and "to" are dates in "yyyy-mm-dd" format. "limit" is an integer of how many logs to send back.
// tests completed
// console output
[TypeError: Cannot read properties of undefined (reading 'description')]
[TypeError: Cannot read properties of undefined (reading 'duration')]
[TypeError: Cannot read properties of undefined (reading 'date')]
Your project link(s)
- Solution: https://blabla-5000.asse.devtunnels.ms (localhost:5000)
- Github Link: Boilerplate project exercise tracker challenge
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Challenge Information:
Back End Development and APIs Projects - Exercise Tracker