Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MongoMemoryReplSet support #320

Merged
merged 4 commits into from
Dec 28, 2021

Conversation

arisjulio
Copy link
Contributor

  • Add replica set support. It just need to add the replSet field in jest-mongodb-config.js to start working as a replica set.
  • Add test script with replica set enabled

Resolve #152

@vladholubiev
Copy link
Member

Thanks for the contribution, @arisjulio!

Would you mind adding a couple of words about this option to the README?

@arisjulio
Copy link
Contributor Author

Would you mind adding a couple of words about this option to the README?

I'll do it before merging

@arisjulio
Copy link
Contributor Author

@vladgolubev

Would you mind adding a couple of words about this option to the README?

Done!

@vladholubiev vladholubiev merged commit d8bdd7f into shelfio:master Dec 28, 2021
@vladholubiev
Copy link
Member

@arisjulio thanks!

Published! https://github.com/shelfio/jest-mongodb/releases/tag/v2.2.0

@dozgunyal
Copy link

Hi, this seems great, Thank you!!!

We now get "MongoError: database name must be a string." errors when we try to connect to replSet.

module.exports = { 
  mongodbMemoryServerOptions: {
    binary: {
      version: '4.0.10',
      skipMD5: true
    },
    autoStart: false,
    instance: {
      dbName: 'jest'
    },
    replSet: {
      count: 3,
      storageEngine: 'wiredTiger',
    },
  }
};

We tried with and without dbName in instance.

It seems database name is not in the MONGO_URI.
Are we doing something wrong or could you add the database name in the URI?

Should I open a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

MongoMemoryReplSet support
3 participants