Hi
I guess I have done all necessary steps (at least not seeing what is missing), but the connection is not hsppening
jest --passWithNoTests “db-connection”
Determining test suites to run…Setup Mongo Connection
FAIL test/db-connection.test.js
● Test suite failed to run
TypeError: Cannot read property 'close' of undefined
17 |
18 | async teardown() {
> 19 | await this.global.mflixClient.close()
| ^
20 | await super.teardown()
21 | }
22 |
at MongoEnvironment.teardown (test/config/mongoEnvironment.js:19:35)
at Generator.throw (<anonymous>)
Test Suites: 1 failed, 1 total
I have renamed the file to .env
The URI is as below
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-xdxkx.gcp.mongodb.net/test
MFLIX_NS=sample_mflix
I am able to connect with mongo shell to the server, so no issue on F/W
I checked other posts, but similar issue was not answered.
Wondering if there is any node/npm version compatibility issue
I have npm 6.5.0-next.0 and node 11.6.0
When trying to do npm start, I am getting
Error: querySrv EREFUSED _mongodb._tcp.mflix-xdxkx.gcp.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:198:19)
Wondering if there is any issue between version of mongodb driver for Node and MongoDB Atlas version