Coder Social home page Coder Social logo

Comments (9)

nodkz avatar nodkz commented on May 17, 2024

Feel free to create mongodb-memory-server-offline package and add it as optionalDependency. Like it did here https://github.com/graphql-compose/graphql-compose-mongoose/blob/30968a23a40d0bdbf90621984e189439eec13711/src/composeWithMongoose.js#L240-L245 with optional package graphql-compose-pagination.

from mongodb-memory-server.

nodkz avatar nodkz commented on May 17, 2024

Or maybe need to find another solution on your side. Cause mongodb-memory-server-offline will be very FAT package if you will add all supported mongodb versions.

Try to add some options which will instruct where to take mongodb bineries offline from your repo. It will be more right way.

from mongodb-memory-server.

wingedfox avatar wingedfox commented on May 17, 2024

mongo-memory-server-offline package could fetch server during install phase, which will work for virtually everything, except automatic updates. This way package won't be that fat.

from mongodb-memory-server.

nodkz avatar nodkz commented on May 17, 2024

And how it decide which version of mongodb binaries need to install? 3.4, 3.6

from mongodb-memory-server.

wingedfox avatar wingedfox commented on May 17, 2024

There are 2 options:

  1. provide a release for each mongo build
  2. provide (cli?) interface to fetch necessary build right from dependent npm script using pre-install hook

from mongodb-memory-server.

nodkz avatar nodkz commented on May 17, 2024

Ok, let take 1st case. But rename packages something like:

  • mongo-memory-server-download-3.4
  • mongo-memory-server-download-3.6

Where this packages at pre-install will download needed mongo binary to path.resolve(os.homedir(), '.mongodb-binaries') folder.

from mongodb-memory-server.

wingedfox avatar wingedfox commented on May 17, 2024

As long as you won't have 2 different versions for any package given it's OK to use path.resolve(os.homedir(), '.mongodb-binaries',version) and reference correct one from mongo-memory-server.

from mongodb-memory-server.

masudianpour avatar masudianpour commented on May 17, 2024

Any update on this issue?

from mongodb-memory-server.

nodkz avatar nodkz commented on May 17, 2024

By default mongodb-memory-server package installs latest version of mongod in postscripts.
If you want a specific version, you should provide it in your test files with proper timeout for test-runner.

Or you may add some script to your package.json which will execute after package installation:

{
  "scripts": {
    "postinstall": "node ./postinstall.js", 
  }
}

Like it did in this file https://github.com/nodkz/mongodb-memory-server/blob/master/postinstall.js

from mongodb-memory-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.