I had the same issue. I followed the advice here and finally got it to pass. Here’s a summary of things I changed that worked (not sure which are necessary) to help anyone that comes later:
- Double-check references to database and collection names throughout server.js Make sure they actually refer to the database on MongoDB in every instance. This is related to another issue in challenge #8 - Middleware. It didn’t mention to declare a mongoDB var, or change title variable in the server.js file to ‘Home Page’. I figured this out per advice here : MongoError: cannot do raw queries on admin in atlas for advanced node and express challenge
and here: https://github.com/freeCodeCamp/freeCodeCamp/issues/18201#issuecomment-435695091
but the issue followed me to this challenge. Could just be me but thought I’d reference it in case others have issues.
- On the index page, change the title to: Home Profile
and change the h1 to h1.border.center Home Page freeCodeCampTester
- On the profile page, change the title to Profile Page
and change the h1 to h1.border.center Profile Home freeCodeCampTester
- go into Mongo DB, and delete your database. Run the tests (Some say you have to run it twice, but I passed on the first go.)