nodeboot-test-mongodb
Installation
SKILL.md
Testing Node-Boot apps backed by MongoDB
Three hooks, in increasing order of realism/cost — pick the cheapest one that still exercises what
you're testing. All are demonstrated in
demos/node-test-demo/test
of the test framework repo. For the
app-side MongoDB starter setup being tested here, see
nodeboot-starter-persistence-mongodb.
useMongoMemoryServer — default choice
In-memory mongodb-memory-server instance, no Docker required, fastest. Use for any test that
doesn't need transactions or change streams.
const {useMongoMemoryServer} = useNodeBoot(EmptyApp, ({useMongoMemoryServer}) => {
useMongoMemoryServer({instance: {dbName: "custom-test-db"}}); // port, dbName, storageEngine all optional
});