systemic-mongodb-memory-server
v1.0.0
Published
Systemic component to use temporal mongodb server for testing
Downloads
3
Keywords
Readme
systemic-mongodb-memory-server
A systemic mongodb-memory-server component for testing without docker or dedicated mongodb servers.
This component create a temporal server for testing and server is destroyed when tests are finished.
Check configuration options for mongodbMemoryServer
at official mongodb-memory-server documentation.
Usage
const System = require('systemic');
const mongodb = require('mongodb-memory-server');
const config = {
mongodbMemoryServer: {
instance: {
db_name: 'test-db',
},
},
};
new System()
.add('config', config, { scoped: true })
.add('mongodb', mongodb())
.dependsOn('config')
.start((err, components) => {
// Do your tests
});