Mongo DB tests fail on

Tell us what’s happening:
All tests fail despite the test conditions seeming to be met.

As far as I can tell, this challenge requires:

  • add mongodb to dependencies in package.json
  • add mongoose to dependencies in package.json
  • add MONGO_URI to .env
  • connect to mongoose database using MONGO_URI environment variable

I believe that the packages are installed correctly because:

  • both appear in package-lock.json
  • both appear when npm list is run from the shell

I believe that the app is connecting to the database because there are no errors on the console. However, I’m not yet sure how to test this further.

I’m attempting to run tests by pasting the public URL from into the “Solution Link” text box and then clicking the button “I’ve completed this challenge.” The output is:

// running tests
"mongodb" dependency should be in package.json
"mongoose" dependency should be in package.json
"mongoose" should be connected to a database
// tests completed

All tests fail.

Can anyone spot the error? I’m uncertain if I’m linking improperly to or if there is a mistake in the code.

Thanks for your help!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0.

Challenge: Install and Set Up Mongoose

Link to the challenge:

Welcome, kevin!

Your project link passes for me. Be sure to pass the correct URL to the solution input, if you are not:

This is the Live App URL, and is the publicly accessible URL once the app is running in the background. The tests need this URL to target.

Hope this helps

Hmmm! Pasting the link to the live app worked.

I think the misconceptions were:

  • use link to app URL, not the repl/editor URL
  • ensure that app is running before the tests are run

I thought I’d tried that, but apparently not :wink:

Thank you for the welcome and for your help!