A Node.js + Mongoose + Jest sample project that demonstrates how to test mongoose operations using Jest with an in-memory database.
This repo was build as an example for my article Testing Node.js + Mongoose with an in-memory database.
What you need to run this project:
(MongoDB is not required because it'll run in memory, handled by the package
Try it out
1. Install dependencies
2. Run tests
Feel free to contribute to this project either by leaving your comments and suggestions in the Issues section or creating a PR. More and diverse test examples are always useful. Make sure to take a look at Jest docs and the existent examples to avoid repeating.
Main tools used in this project: