Hello, I’m hoping someone might be able to help with my Issue Tracker code please. I think I’m almost there but struggling to pass tests 9 and 10. I’ve tried copying the fcc tests from the github repository into my functional tests, which are all passing in my console. I’m guessing somewhere in my api route codes for “put” and “delete” something is going wrong, and is appearing to be successful when it should return an error, but I’m not sure. Any feedback or suggestions would be much appreciated.
Tests 9 and 10 are:
-
When the
PUT
request sent to/api/issues/{projectname}
does not include update fields, the return value is{ error: 'no update field(s) sent', '_id': _id }
. On any other error, the return value is{ error: 'could not update', '_id': _id }
. -
You can send a
DELETE
request to/api/issues/{projectname}
with an_id
to delete an issue. If no_id
is sent, the return value is{ error: 'missing _id' }
. On success, the return value is{ result: 'successfully deleted', '_id': _id }
. On failure, the return value is{ error: 'could not delete', '_id': _id }
.
The messages I’m seeing on freecodecamp for tests 9 and 10 are:
[Error: expected { Object (result, _id) } to deeply equal { error: ‘could not update’, …(1) }]
[Error: expected { Object (result, _id) } to deeply equal { error: ‘could not delete’, …(1) }]
The link to my Replit: boilerplate-project-issuetracker - Replit
Link to my solution: https://8f12e8e0-9f4f-47d9-b6e0-aa55dd7a206b-00-gerr79xltsr1.janeway.replit.dev/
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
This is the challenge:
Quality Assurance Projects - Issue Tracker