Issue Tracker GET tests will not pass

The code below wont pass the GET user stories/tests. Is there a way I can check why the tests aren’t passing and log it? similar to how the python tests are done…
I am able make my own get requests and filter out the issues, so I don’t know why my code is not passing #5 and #6.

you can find my replit here

.get(function (req, res){
      let project = req.params.project;
      //let filter = Object.assign(req.query)

      // Data filter
      let filter = {
        project: project
      }
      
      // Check for query filtering
      if(Object.keys(req.query).length > 0) {
        filter = {
          project: project,
          ...req.query
        }
      } 
      // Find issues for project
      trackerIssue.find({
        ...filter
      }, (err, data) => {
        if(err) return console.log("Error:\n" + err)
         return res.json(data)
      // Hide unnecessary fields
      }).select({ project: 0, __v: 0 })

})

Thank you for any help you can provide.

Look at the browser console when you submit.


You can find the tests in the main repo

https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/issue-tracker.md
1 Like