@@ -10,16 +10,10 @@ import kotlin.test.*
1010
1111expect val emulatorHost: String
1212expect val context: Any
13- expect fun runTest (skip : Boolean = false, test : suspend () -> Unit )
14- expect val currentPlatform: Platform
15-
16- enum class Platform { Android , IOS , JS }
13+ expect fun runTest (test : suspend () -> Unit )
1714
1815class FirebaseAuthTest {
1916
20- // Skip the tests on iOS simulator due keychain exceptions
21- private val skip = currentPlatform == Platform .IOS
22-
2317 @BeforeTest
2418 fun initializeFirebase () {
2519 Firebase
@@ -41,14 +35,14 @@ class FirebaseAuthTest {
4135 }
4236
4337 @Test
44- fun testSignInWithUsernameAndPassword () = runTest(skip) {
38+ fun testSignInWithUsernameAndPassword () = runTest {
4539 val uid = getTestUid(" test@test.com" , " test123" )
4640 val result = Firebase .auth.signInWithEmailAndPassword(" test@test.com" , " test123" )
4741 assertEquals(uid, result.user!! .uid)
4842 }
4943
5044 @Test
51- fun testCreateUserWithEmailAndPassword () = runTest(skip) {
45+ fun testCreateUserWithEmailAndPassword () = runTest {
5246 val email = " test+${Random .nextInt(100000 )} @test.com"
5347 val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
5448 assertNotEquals(null , createResult.user?.uid)
@@ -63,7 +57,7 @@ class FirebaseAuthTest {
6357 }
6458
6559 @Test
66- fun testFetchSignInMethods () = runTest(skip) {
60+ fun testFetchSignInMethods () = runTest {
6761 val email = " test+${Random .nextInt(100000 )} @test.com"
6862 var signInMethodResult = Firebase .auth.fetchSignInMethodsForEmail(email)
6963 assertEquals(emptyList(), signInMethodResult)
@@ -75,7 +69,7 @@ class FirebaseAuthTest {
7569 }
7670
7771 @Test
78- fun testSendEmailVerification () = runTest(skip) {
72+ fun testSendEmailVerification () = runTest {
7973 val email = " test+${Random .nextInt(100000 )} @test.com"
8074 val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
8175 assertNotEquals(null , createResult.user?.uid)
@@ -85,7 +79,7 @@ class FirebaseAuthTest {
8579 }
8680
8781 @Test
88- fun sendPasswordResetEmail () = runTest(skip) {
82+ fun sendPasswordResetEmail () = runTest {
8983 val email = " test+${Random .nextInt(100000 )} @test.com"
9084 val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
9185 assertNotEquals(null , createResult.user?.uid)
@@ -96,7 +90,7 @@ class FirebaseAuthTest {
9690 }
9791
9892 @Test
99- fun testSignInWithCredential () = runTest(skip) {
93+ fun testSignInWithCredential () = runTest {
10094 val uid = getTestUid(" test@test.com" , " test123" )
10195 val credential = EmailAuthProvider .credential(" test@test.com" , " test123" )
10296 val result = Firebase .auth.signInWithCredential(credential)
0 commit comments