Contributions to the package are very welcome.
The toolchain required for development include:
- Node.js
- NPM
- Docker
- Docker-Compose
To install all dependencies:
npm install
Installing dependencies is required for everything, except for running the tests using Docker-Compose.
To build the project:
npm test
It's a weird naming, but it basically tests if the project is compiled successfully.
Probably the easiest way to run the tests is using Docker-Compose:
npm run docker:test:replicaset
This will create a MongoDB replicaset and run the tests against them. To clean-up afterwards, do:
npm run docker:test:clean-up
If you have a stand-alone instance of MongoDB up and running on your localhost
,
you can run the tests against it by:
npm run test:standalone
To tests against a replica-set, with the primary exposed on your localhos
, do:
npm run test:replicaset
The Docker-Compose configuration can create a replica-set for you:
docker-compose up -d mongodb-primary mongodb-secondary mongodb-arbiter
Let's say you have a replica-set on your own cloud or something, you can run the tests against them by setting the correct environment variables:
MONGODB_HOST
: the host addressMONGODB_ROOT_USER
: the root usernameMONGODB_ROOT_PASSWORD
: the root password