hello, i can’t make the test passe (1) even though my tests are passing, can anyone help?
1: 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 } .
the problem was that using mongoose method ‘findByIdAndUpdate’ doesn’t throw an error and stays pending when the id does not exist, so I managed to use the method ‘findById’ which return null if it does find nothing then routes to the corresponding response.
thanks, everyone.