Runs mongod. Useful when testing APIs.
npm install mongod-run2This is a fork of gtramontina/mongod-run where all the real work was done. Unfortunately, there were some changes in Node 7.x that broke the original package.
``javascript
var mongodRun2 = require('mongod-run2');
if(!isProduction) {
mongodRun2.start(() => {
this.doAfterMongoStart();
})
}
else {
this.doAfterMongoStart();
}
`
`javascript
var mongod = require('mongod-run');
before(mongod.start);
after(mongod.stop);
describe('my app', function () {
// ...
});
`
: runs mongod and call the callback once it is up and running.
* stop(): kills the mongod process. This is automatically called if/when the test process exits.Notes
The mongod process is being ran with the following command:
`bash
$ mongod -f --rest
``