Table of Contents generated with DocToc
A simple helper, setup helper and stop helper.
Handy for usage in jest tests, beforeAll and afterAll... but also/mainly.. I didn't want to write tests for this in my APIs or ignore in APIs jest config files.
It assumes you use mongoose, should be installed in your API. It is marked as a peer dep in this package.json file.
It does not assume you install mongodb-memory-server so installed as a dependency to this package.
import OpenapiNodegenMemMongoLoader from 'openapi-nodegen-mem-mongo-loader';
describe('registerEmailPost domain', () => {
beforeAll(async () => {
await OpenapiNodegenMemMongoLoader.setup();
});
afterAll(async () => {
await OpenapiNodegenMemMongoLoader.teardown();
});
// add some tests
})
Pull requests welcomed as always.