Runs mongod. Useful when testing APIs.
npm install mongod-runmongod-run.``javascript
var mongod = require('mongod-run');
before(mongod.start);
after(mongod.stop);
afterEach(mongod.cleanup('mongodb://localhost:27017/example.test'));
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.
* cleanup(url): performs a cleanup on the database specified by the given url.Notes
The mongod process is being ran with the following command:
`bash
mongod -f . --dbpath= --rest
``_I have the feeling that customizing this command line might be something that people might want to do. If so, feel free to submit a pull request!_