Hi,
I am trying to run the first test
npm test -t db-connection
Here is the response I get:
> server@1.0.0 test
> jest --passWithNoTests "db-connection"
Determining test suites to run...Setup Mongo Connection
FAIL test/db-connection.test.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.301 s
Ran all test suites matching /db-connection/i.
Teardown Mongo Connection
(node:59180) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:59180) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:59180) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:59180) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
When I visit http://localhost:5000/ the datas seem to load correctly to the front, it seems like the connection to the database works. So is it just the test that failed to run? Any idea how I can fix this?