I can’t find where I’m getting wrong
Hello everyone!
I was completing my Exercise Tracker project and I thought I did everything correctly. I tested and I get the expected outputs, but I can’t pass FCC test.
Just look at your console on repl.it after you run the fCC tests. I’m getting a bunch of unhandled promise rejection errors from your findAndFilterInfo, so I would start debugging there. Those errors are tricky. When I log from your /api/users/:id/exercises route, the response is always undefined from findAndUpdateUser, which is why the tests for that route are failing.
You’re going to have to go through all the functions for that route (and all the routes preferably) and log the input and responses to understand what they are currently doing so that you can make them do what they should be doing.
So, I discovered some of the problems.
In the pipeline of findAndFilterInfo, I made some mistakes in my conditions that were allowing falsefromDate and toDate to pass.
The other error is when the user has no log. Should return an object with log as an empty array, but at the moment does return nothing. I’m trying to look how to fix that.
I just wanted to leave the info, in case someone else get stuck on the same problem.