Error with: npm test -t connection-pooling

jest --passWithNoTests “connection-pooling”

Determining test suites to run…Setup Mongo Connection
FAIL test/connection-pooling.test.js
Connection Pooling
× Connection pool size is 50 (91ms)

● Connection Pooling › Connection pool size is 50

expect(received).toBe(expected) // equality

Expected: 50
Received: undefined


  Comparing two different types of values. Expected number but received undefined.

   8 |   test("Connection pool size is 50", async () => {
   9 |     const response = await MoviesDAO.getConfiguration()
> 10 |     expect(response.poolSize).toBe(50)
     |                               ^
  11 |   })
  12 | })
  13 |

  at toBe (test/connection-pooling.test.js:10:31)
  at tryCatch (node_modules/regenerator-runtime/runtime.js:62:40)
  at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:296:22)
  at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:114:21)
  at step (node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
  at node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13

Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 4.329s
Ran all test suites matching /connection-pooling/i.
Teardown Mongo Connection
npm ERR! Test failed. See above for more details.

1 Like

Hi @PCI,

There has been some miscommunication I believe. In README section, the npm test command is used just for an example to show how to run unit test cases for coming tickets.

You don’t need to run it for now. :slight_smile:


There is a “Bear in mind that a tests will fail until the corresponding ticket is completed.” but I was also uncertain if that command should or should not fail as we just setup the connection to the DB.

It would be advisable to mention in the README that this command is NOT supposed to pass at this time.

1 Like

Thanks for the suggestion @Sebastian_33972.


Good point @Sebastian_33972 - I remember reading it, but took me 20 minutes to troubleshoot till I came across this post. Moving on…

Thanks for reminding me the same. It will be fixed in maximum 1 or 2 working days. :slight_smile: