Tell us what’s happening:
I passed all the tests except the 10 tests.
All of them pass in my backend, but still cannot pass the exam.
What is the tester looking for? How do I solve this?
Also I noticed the first test always fail. Any way I can tell the tester script to wait until mongoose is connected?
Your project link(s)
solution: library - Replit
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Challenge: Quality Assurance Projects - Personal Library
Link to the challenge:
I pasted your test code into my repl (as I’ve previously completed this project) and you are failing 2 of the functional tests:
1) Functional Tests Routing tests GET /api/books/[id] => book object with [id] Test GET /api/books/[id] with valid id in db:
Uncaught AssertionError: Books in array should contain commentcount: expected { Object (_id, title, ...) } to have property 'commentcount'
at tests/2_functional-tests.js:112:20
at Test.Request.callback (node_modules/superagent/lib/node/index.js:716:12)
at node_modules/superagent/lib/node/index.js:916:18
at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/parsers/json.js:19:7)
at IncomingMessage.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
2) Functional Tests Routing tests POST /api/books/[id] => add comment/expect book object with id Test POST /api/books/[id] with comment:
Uncaught AssertionError: Books in array should contain commentcount: expected { Object (_id, title, ...) } to have property 'commentcount'
at tests/2_functional-tests.js:134:20
at Test.Request.callback (node_modules/superagent/lib/node/index.js:716:12)
at node_modules/superagent/lib/node/index.js:916:18
at IncomingMessage.<anonymous> (node_modules/superagent/lib/node/parsers/json.js:19:7)
at IncomingMessage.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Got it. Thanks you so much!
I see your issue. You could also try rerunning the tests on another site
This post was flagged by the community and is temporarily hidden.