forked from jmug/stoatchat
refactor: clean up database before and after tests
This commit is contained in:
@@ -63,13 +63,12 @@ macro_rules! database_test {
|
|||||||
.await
|
.await
|
||||||
.expect("Database connection failed.");
|
.expect("Database connection failed.");
|
||||||
|
|
||||||
|
db.drop_database().await;
|
||||||
|
|
||||||
#[allow(clippy::redundant_closure_call)]
|
#[allow(clippy::redundant_closure_call)]
|
||||||
(|$db: $crate::Database| $test)(db.clone()).await;
|
(|$db: $crate::Database| $test)(db.clone()).await;
|
||||||
|
|
||||||
match db {
|
db.drop_database().await
|
||||||
$crate::Database::Reference(_) => {}
|
|
||||||
$crate::Database::MongoDb(db) => db.0.database(&db.1).drop(None).await.unwrap(),
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user