openapi-nodegen-mem-mongo-loader
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

License | Dependencies | Codecov Coverage | Build Status

openapi-nodegen-mem-mongo-loader

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.

Perquisites

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.

Example

import OpenapiNodegenMemMongoLoader from 'openapi-nodegen-mem-mongo-loader';
describe('registerEmailPost domain', () => {

  beforeAll(async () => {
    await OpenapiNodegenMemMongoLoader.setup();
  });

  afterAll(async () => {
    await OpenapiNodegenMemMongoLoader.teardown();
  });
  // add some tests
})

Contribution

Pull requests welcomed as always.

Package Sidebar

Install

npm i openapi-nodegen-mem-mongo-loader

Weekly Downloads

1

Version

2.1.0

License

none

Unpacked Size

15.3 kB

Total Files

12

Last publish

Collaborators

  • carmichael.john