WIP mongodb-memory-serve

This commit is contained in:
negue
2024-10-29 22:43:03 +01:00
parent 7c9b7be012
commit cce4363319
7 changed files with 562 additions and 22 deletions

View File

@@ -21,6 +21,7 @@ export async function getProperty (collectionName, id, path) {
// Specifically helpful for the GET /groups tests,
// resets the db to an empty state and creates a tavern document
export async function resetHabiticaDB () {
console.info('Resetting Habitica DB');
const groups = mongoose.connection.db.collection('groups');
const users = mongoose.connection.db.collection('users');
return mongoose.connection.dropDatabase()