[j@work mflix-js]$ npm test -t mongoclient
server@1.0.0 test
jest --passWithNoTests “mongoclient”
Determining test suites to run…Setup Mongo Connection
FAIL test/lessons/mongoclient.spec.js
● Test suite failed to run
TypeError: Class constructor NodeEnvironment cannot be invoked without 'new'
at new MongoEnvironment (test/config/mongoEnvironment.js:30:113)
at async TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
at async runJest (node_modules/@jest/core/build/runJest.js:404:19)
at async _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
at async runCLI (node_modules/@jest/core/build/cli/index.js:173:3)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.085 s
Ran all test suites matching /mongoclient/i.
Teardown Mongo Connection
(node:2505966) Warning: Accessing non-existent property ‘count’ of module exports inside circular dependency
(Use node --trace-warnings ...
to show where the warning was created)
(node:2505966) Warning: Accessing non-existent property ‘findOne’ of module exports inside circular dependency
(node:2505966) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:2505966) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
I appear to be getting the above error on every uni test.