Chapter 1; example m220js mongoclient:
In the example code you do not use the expression let testClient
,
but try {
const testClient = await MongoClient.connect(
…
This I tried, but it gives an error:
$ npm test -t mc
server@1.0.0 test D:\Projects\M220\mflix-js
jest --passWithNoTests “mc”
Determining test suites to run…Setup Mongo Connection
FAIL ./mc.spec.js
MongoClient
× Client initialized with URI (811ms)
● MongoClient › Client initialized with URI
ReferenceError: testClient is not defined
21 | expect(e).toBeNull()
22 | } finally {
> 23 | testClient.close()
| ^
24 | }
25 | })
26 |
So, I am unsure if your example is correct?
Thanks for your support,
Regards, Ad