Tests are failing with following message

Test Suites: 1 failed, 1 total
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: 6.431s
Ran all test suites matching /callbacks-promises-async.spec.js/i.
Teardown Mongo Connection
npm ERR! Test failed. See above for more details.

when i tried to run to npm test -t callbacks-promises-async.spec.js in command line i found above issue.

Hi @PRASHANTH_72784,

To test the unit-tests, you need to run the command like below for Ticket: Connection:

 npm test -t db-connection

It is always mentioned in the Ticket description to what to run to check. Let me know if you need more help.

Kanika

even after executing npm test -t db-connection command facing same issue

Hi @PRASHANTH_72784,

Please check the node version. I am using v12.4.0. To check, please run the command:

 node --version

Kanika

I have checked the version…

v10.15.3 version which is displayed after executing the command, so wat would be the issue can u pls help.

Hi @PRASHANTH_72784,

After reading the screenshot again, there is a missing curly bracket on const query line.
Also, the field name should be genres and not genre.
It should be like this:

   const query = { genres: { $in: searchGenre } } 

Kanika