Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

[Feature request] Add unit / local test suite that uses in-memory MongoDB  #133

Open
@htbkoo

Description

@htbkoo

I think currently all tests depend on an actual MongoDB instance to run - this is great for end-to-end tests which make sure everything is fine.

However I wonder if we could also add a local test suite which would test the app in a similar way but connecting to an in-memory mongoDB instead. (e.g. this mongodb-memory-server seems to be quite promising according to the official instructions in Jest)

The pros are:

  1. in our tests we would not have to worry about the DB external dependency
  2. we do not have to maintain the database state manually as the data will be gone once the in memory db is torn down
  3. the projects and the tests become more standalone

The cons are (maybe):

  1. the test setup is exactly the same as in Production
  2. the tests would depend on the in-memory DB library

Or please let me know if there is any reason I had missed. :-)
And thanks so much for the great work of this starter repo. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions