Testing with mongodb-memory-server

mongodb-memory-server starts a real, throwaway MongoDB for a test file, so before starts it, beforeEach gives every test the same fresh data, Supertest tests the whole API against it, and after stops it, with your own data never touched.

By

Updated

Cheat sheet: Testing with mongodb-memory-server
Category
Node.js
Level
Journeyman
Tags
Integration Test, mongodb, mongodb-memory-server, node:test, nodejs, Test Isolation, unit testing