wongz
March 1, 2020, 11:51pm
1
Hi everyone, working on the Personal Library here:
https://www.freecodecamp.org/learn/information-security-and-quality-assurance/information-security-and-quality-assurance-projects/personal-library
I’m able to connect to my database but in all my tests, I keep getting an “Uncaught AssertionError: expected 404 to equal 400” for every single test question in my console.
I’ve been spinning my wheels a bit. Just wondering if anyone is able to see something glaringly obvious that I’m missing?
Glitch Project Code:
Combining automated deployment, instant hosting & collaborative editing, Glitch gets you straight to coding so you can build full-stack web apps, fast
wongz
March 1, 2020, 11:53pm
2
All tests have errors like this…
Uncaught AssertionError: expected 404 to equal 200
-404 +200
at chai.request.get.send.send.end (tests/2_functional-tests.js:133:19)
at Test.Request.callback (/rbd/pnpm-volume//node_modules/.registry.npmjs.org/superagent/3.8.3/node_modules/superagent/lib/node/index.js:716:12)
at IncomingMessage.parser (/rbd/pnpm-volume//node_modules/.registry.npmjs.org/superagent/3.8.3/node_modules/superagent/lib/node/index.js:916:18)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
wongz
March 3, 2020, 9:50pm
3
I realized I was connecting to MongoDB once within the exported function. It was fixed by connecting to MongoDB within each GET, POST, DELETE request.