-1

I'm trying to use Jest with MongoDB-memory-server, but every time i try to connect it i get this error, i would like to know from you guys if there's any way to solve it?

Error: Jest: Got error running globalSetup - .../node_modules/@shelf/jest-mongodb/setup.js

My ubuntu version:

Ubuntu 22.04 LTS Release:   22.04
Codename:   jammy
Artur Meinild
  • 26,018

1 Answers1

1

I believe this is not an issue with Jest itself, but is specific to MongoDB server on Ubuntu 22.04. I have been encountering the same issue and have tried running the same test code on my Macbook with no issue. Specifically, the issue is there is not yet an official MongoDB build for Ubuntu 22.04.

It does seem to be known about by the Mongo team and they are working on an official release, as mentioned here: https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/16

You can get around this issue by first installing libssl1.1 and then installing mongodb-org. I would caution that this is not recommended for security reasons but if you must, then it is an option. Full instructions are documented in this existing issue: MongoDB Install Fails on Ubuntu 22.04 - Depends on libssl1.1 but it is not installable