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

Is it possible to run 2 different mongodb-memory-server in the same test? #367

Open
PauloFavero opened this issue Jul 29, 2022 · 0 comments

Comments

@PauloFavero
Copy link

Hi everyone,

I have a test case where I need to connect simultaneously in two different dbs. Let's say I have a db_A and db_B.
I need to query some data from db_A and then query more data from db_B.
The result needs to be a combination of those queries.

My jest MongoDB config is as follows:

module.exports = {
  mongodbMemoryServerOptions: {
    instance: {
      dbName: 'jest'
    },
    binary: {
      version: '4.4.0',
      skipMD5: true
    },
    autoStart: false
  }
}

Is there a way where I can modify this config to have 2 dbs instances? If yes, what would be the procedures to open the connection? I believe that the MONGO_URL won't work in that case.

Thanks

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

No branches or pull requests

1 participant