refactor: clean up database before and after tests

This commit is contained in:
Paul Makles
2023-04-22 16:01:07 +01:00
parent b8cda2ec74
commit eacf4decab

View File

@@ -63,13 +63,12 @@ macro_rules! database_test {
.await
.expect("Database connection failed.");
db.drop_database().await;
#[allow(clippy::redundant_closure_call)]
(|$db: $crate::Database| $test)(db.clone()).await;
match db {
$crate::Database::Reference(_) => {}
$crate::Database::MongoDb(db) => db.0.database(&db.1).drop(None).await.unwrap(),
}
db.drop_database().await
};
}