Pass a reference to TestAppContext in tests

This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
This commit is contained in:
Antonio Scandurra 2022-03-01 12:01:02 +01:00
parent 8390f04e7d
commit 466db69780
20 changed files with 748 additions and 819 deletions

View file

@ -627,7 +627,7 @@ pub mod tests {
use util::post_inc;
#[gpui::test]
async fn test_get_users_by_ids(cx: TestAppContext) {
async fn test_get_users_by_ids(cx: &mut TestAppContext) {
for test_db in [TestDb::postgres(), TestDb::fake(cx.background())] {
let db = test_db.db();
@ -667,7 +667,7 @@ pub mod tests {
}
#[gpui::test]
async fn test_recent_channel_messages(cx: TestAppContext) {
async fn test_recent_channel_messages(cx: &mut TestAppContext) {
for test_db in [TestDb::postgres(), TestDb::fake(cx.background())] {
let db = test_db.db();
let user = db.create_user("user", false).await.unwrap();
@ -703,7 +703,7 @@ pub mod tests {
}
#[gpui::test]
async fn test_channel_message_nonces(cx: TestAppContext) {
async fn test_channel_message_nonces(cx: &mut TestAppContext) {
for test_db in [TestDb::postgres(), TestDb::fake(cx.background())] {
let db = test_db.db();
let user = db.create_user("user", false).await.unwrap();

File diff suppressed because it is too large Load diff