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

Support for mongodb-memory-server version 7.x #14

Open
LinusU opened this issue Feb 26, 2021 · 3 comments · May be fixed by #28
Open

Support for mongodb-memory-server version 7.x #14

LinusU opened this issue Feb 26, 2021 · 3 comments · May be fixed by #28

Comments

@LinusU
Copy link

LinusU commented Feb 26, 2021

Version 7.x added support for my platform (arm64), but it doesn't seem like we are compatible with version 7.x yet. I'm getting the following error:

  ● Test suite failed to run

    "instanceInfo" is undefined

      at assertionInstanceInfo (node_modules/mongodb-memory-server-core/src/MongoMemoryServer.ts:721:38)
      at MongoMemoryServer.getUri (node_modules/mongodb-memory-server-core/src/MongoMemoryServer.ts:632:5)
      at EphemeralEnvironment.setup (node_modules/jest-environment-mongodb/src/index.ts:46:47)

related: nodkz/mongodb-memory-server#213

@snitovets
Copy link

from 7.x.x versions MongoMemoryServer instance have to starts manually:

mongod = new MongoMemoryServer();
await mongod.start();

const mongoUri = mongo.getUri();

await mongoose.connect(mongoUri, {
	useCreateIndex: true,
	useNewUrlParser: true,
	useUnifiedTopology: true
});

@lirbank
Copy link
Owner

lirbank commented Oct 13, 2021

Hey, thanks for posting this issue! I personally hold mongodb-memory-server to version 6.x because of the same reasons as you, so this is definitely something I am interested in fixing. Just got to find the time. Would be happy to accept a PR too if you have the inclination.

Potentially related (or not), I have an old branch with some work to support replicasets. Not sure if mongodb-memory-server 7.x makes this any easier, need to explore that when the time comes.

@boredland boredland linked a pull request Mar 25, 2023 that will close this issue
@boredland
Copy link

Hi there! Created a PR that should squash all the deprecations at once, including this one. Would appreciate a review! #28

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

Successfully merging a pull request may close this issue.

4 participants