@@ -10,10 +10,12 @@ import dev.gitlive.firebase.apps
10
10
import dev.gitlive.firebase.initialize
11
11
import dev.gitlive.firebase.runBlockingTest
12
12
import dev.gitlive.firebase.runTest
13
+ import kotlinx.coroutines.delay
13
14
import kotlin.test.AfterTest
14
15
import kotlin.test.BeforeTest
15
16
import kotlin.test.Test
16
17
import kotlin.test.assertFalse
18
+ import kotlin.time.Duration.Companion.seconds
17
19
18
20
expect val emulatorHost: String
19
21
expect val context: Any
@@ -51,37 +53,57 @@ class FirebaseCrashlyticsTest {
51
53
@Test
52
54
fun testRecordException () = runTest {
53
55
crashlytics.recordException(Exception (" Test Exception" ))
56
+
57
+ // Delay to ensure Crashlytics completes
58
+ delay(1 .seconds)
54
59
}
55
60
56
61
@Test
57
62
fun testLog () = runTest {
58
63
crashlytics.log(" Test Log" )
64
+
65
+ // Delay to ensure Crashlytics completes
66
+ delay(1 .seconds)
59
67
}
60
68
61
69
@Test
62
70
fun testSetUserId () = runTest {
63
71
crashlytics.setUserId(" Test User Id" )
64
72
73
+ // Delay to ensure Crashlytics completes
74
+ delay(1 .seconds)
65
75
}
66
76
67
77
@Test
68
78
fun testSendUnsentReports () = runTest {
69
79
crashlytics.sendUnsentReports()
80
+
81
+ // Delay to ensure Crashlytics completes
82
+ delay(1 .seconds)
70
83
}
71
84
72
85
@Test
73
86
fun testDeleteUnsentReports () = runTest {
74
87
crashlytics.deleteUnsentReports()
88
+
89
+ // Delay to ensure Crashlytics completes
90
+ delay(1 .seconds)
75
91
}
76
92
77
93
@Test
78
94
fun testDidCrashOnPreviousExecution () = runTest {
79
95
val didCrash = crashlytics.didCrashOnPreviousExecution()
80
96
assertFalse { didCrash }
97
+
98
+ // Delay to ensure Crashlytics completes
99
+ delay(1 .seconds)
81
100
}
82
101
83
102
@Test
84
103
fun testSetCrashlyticsCollectionEnabled () = runTest {
85
104
crashlytics.setCrashlyticsCollectionEnabled(true )
105
+
106
+ // Delay to ensure Crashlytics completes
107
+ delay(1 .seconds)
86
108
}
87
109
}
0 commit comments